20tab / UnrealEnginePython

Embed Python in Unreal Engine 4
MIT License
2.77k stars 754 forks source link

pycharm or VSCode remote debug? #818

Open pilgrim333 opened 4 years ago

pilgrim333 commented 4 years ago

I was wondering if anyone has gotten pycharm or VSCode remote debug to work with UE4? If so, can you share? If not, is there anything else that works for debugging besides print statements? Thank you.

pilgrim333 commented 4 years ago

I noticed that using UE4's python version and "File | Execute Python Script", UE4 complains with "No module named unreal_engine.classes" in my script:

sys.path.append("C:/Program Files/JetBrains/PyCharm 2019.3.1/plugins/python/helpers/pydev") import pydevd pydevd.stoptrace() pydevd.settrace('localhost', port=60058, stdoutToServer=True, stderrToServer=True, suspend=False) from unreal_engine.classes import PyFbxFactory print("hello")

If I run the above script using the embeded version of UnrealEnginePython's "Python Editor | Execute", UE4 does print out the "hello" but it prints out the WARNING below and it doesn't break at my set breakpoint:


pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled (internal generated filenames are not absolute) pydev debugger: The debugger may still function, but it will work slower and may miss breakpoints. pydev debugger: Related bug: http://bugs.python.org/issue1666807

pydev debugger: Unable to find real location for: pydev debugger: Unable to find real location for: threading.py pydev debugger: Unable to find real location for: ntpath.py pydev debugger: Unable to find real location for: genericpath.py pydev debugger: Unable to find real location for: ctypes__init__.py pydev debugger: Unable to find real location for: pydev debugger: Unable to find real location for: urllib\parse.py pydev debugger: Unable to find real location for: queue.py hello

Any ideas what I can try next?