# load\_level in python script cause crash

**URL:** <https://forums.unrealengine.com/t/load-level-in-python-script-cause-crash/2243643>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [December 26, 2024, 1:15pm UTC](https://forums.unrealengine.com/t/load-level-in-python-script-cause-crash/2243643 "2024-12-26T13:15:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ken\_An](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ken_an/32/866880_2.png) [@Ken\_An](https://forums.unrealengine.com/u/Ken_An)\
**Post date:** [December 26, 2024, 1:15pm UTC](https://forums.unrealengine.com/t/load-level-in-python-script-cause-crash/2243643/1 "2024-12-26T13:15:01Z")

</div>

I’m trying to run a python script using UnrealEditor-Cmd.exe, following this document:  
[official documents](https://dev.epicgames.com/documentation/en-us/unreal-engine/scripting-the-unreal-editor-using-python#thecommandline)

it says:  
This commandlet does not automatically load levels, so when writing your script, add the following line as the first thing it does:

```python
unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level("/Game/maps/UVlayoutTest.UVlayoutTest")

```

I followed the instruction, but when I run the script in command line, it generated a ue crash window:

 ![a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/f/1efcdeea964bfb2c98a5f53a099ed094350044ab.png)

I’m sure the level path is correct, I tried both these paths, none of them works

```auto
load_level('/Game/Scene/Triangulation.Triangulation')
load_level('/Game/Scene/Triangulation')

```

the error :

```auto
[2024.12.26-13.13.27:836][0]LogPythonScriptCommandlet: Display: Running Python script: D:\Dev\UEProjects\UtilityScripts\GetSceneInfo.py
[2024.12.26-13.13.29:876][0]LogStaticMesh: Display: Building static mesh StaticMesh_0 (Required Memory Estimate: 0.00765 MB)...
[2024.12.26-13.13.29:892][0]LogStaticMesh: Display: Building static mesh StaticMesh_1 (Required Memory Estimate: 0.056971 MB)...
[2024.12.26-13.13.29:924][0]LogOutputDevice: Warning:

Script Stack (1 frames) :
/Script/LevelEditor.LevelEditorSubsystem.LoadLevel

[2024.12.26-13.13.29:931][0]LogWindows: Error: appError called: Assertion failed: IsValid() [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Templates\SharedPointer.h] [Line: 1102]
......

```
