Download

Debugging Python in Unreal 5 (or even 4.X)

Hello -

We are using python 3.7 for editor scripting. That’s all working fine, but I’d like to get a debugger working for debugging python code while it’s running. I have been able to get this to work by loading up pydevd out of pycharm installation (and even loading up pydevd from a standalone python 3.7 installation). I wanted to put pydevd inside of the unreal python installation so that I had everything that I needed in the unreal project and not have to guess where someone might have pydevd installed. But that doesn’t seem to work (due to modification made to Unreal’s python source). The ultimate problem is that module filenames (i.e. inspected by module.co_filename) are relative and not full paths (which makes sense given this is embedded in unreal).

I’m curious if anyone else has been able to solve this problem somehow without having to rely on an outside install of pydevd to set up python debugging. Thanks

I’ve been using Visual Studio (2022) to debug Blender with Python to fix UE BlenderTools problems:
https://github.com/EpicGames/BlenderTools

I mention this because I am in the process of debugging the UE Python response to the tool request (send2u2). I expect the debugging to behave in the same manner.