UE4.27 crashes while running python script

When i execute this script in UE4, it works successfully.
When i run this script on command line with:

“C:\Program Files\Epic Games\UE_4.27\Engine\Binaries\Win64\UE4Editor-Cmd.exe” “C:\Users\Documents\Unreal Projects\test\test.uproject” -run=pythonscript -script=“D:/test_unreal.py”

I get this error and UE4 crashes:

The python script has only these lines:

import unreal
import time
unreal.EditorLevelLibrary.load_level(asset_path=‘/Game/StarterContent/Maps/Minimal_Default’)
unreal.EditorLevelLibrary.spawn_actor_from_object(unreal.CameraActor(name=‘camera1’), location=(0,0,0))

Up to the third line it works fine, but its the 4th line that crashes UE when running it from command line. Anyone knows why??

Hi PengSengAng,

For help troubleshooting your individual project, we recommend you post your question on our Q&A forum .

Thanks!

Hi,

When I click the links you sent, they prompted that the page does not exist or is private. Is the link broken or is there another way for me to access it? Thanks

Yup, it seems it was recently migrated. I’ve updated the link.