Hey everyone so I’ve been trying to run Python scripts in Unreal Engine for a while now and just when I got past all the include saga, I’m met with this error:
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000010
python39
python39
python39
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll
What am I running? Just these two extra lines in an actor class:
// Called when the game starts or when spawned
void APyManager::BeginPlay() { Super::BeginPlay();
Py_Initialize();
PyRun_SimpleString("print('hello')"); --> this boy is causing the issue
}
Everything compiles just fine, only while running the game does it crash. I tried a whole different approach of running python in a different thread and it still crashes, no idea why. What I do know is that the problem is specific to UE, I tried embedding the same code in a C++ console app and it runs just fine. Also, I don’t think the violation has anything to do with the GPU?
Any help is appreciated.