Unreal Python paths
Let’s explore Unreal Python paths for importing Python modules in Unreal
site paths¶
site.getsitepackages()
'../../../Engine/Binaries/ThirdParty/Python3/Win64'
'../../../Engine/Binaries/ThirdParty/Python3/Win64\\Lib\\site-packages'
both of these folders are added to sys.path by Unreal
This folder doesn’t exist atm
sys.path¶
paths (in import order)
Unreal editor paths
unreal install folder D:\\Program Files\\Epic Games\\UE_5.4\\Engine
Unreal project paths
project Python folder
project site packages
project plugin python paths
MYPROJECT/Plugins/python-script-editor/PythonScriptEditor/Content/Python
MYPROJECT/Plugins/hello-world-template/MyPlugin/Content/Python
MYPROJECT/Plugins/texture-browser/TextureBrowser/Content/Python
MYPROJECT/Plugins/unreal-qt/UnrealQt/Content/Python
MYPROJECT/Plugins/Pyblish/Content/Python
MYPROJECT/Plugins/Plugget/Content/Python
Unreal editor default plugin paths
unreal install folder plugins D:/Program Files/Epic Games/UE_5.4/Engine
other paths
project site packages (again) TODO figure out why split in 2.
MYPROJECT\\Intermediate\\PipInstall\\Lib\\site-packages
MYPROJECT\\Content\\Python\\Lib\\site-packages\\unreal_script_editor\\..
other, likely manual path manipulation from script?
Broken or unused paths?¶
I discovered a folder
Which, it being a
Content
folder, implies we can do Content/Python
, since Unreal auto handles all Python
folders in a Content
folder. But modules in there are not importable, and the path is not added to site packages
There’s also
Which contains an empty .pth file, implying site packages usage.
But currently this is not hooked up I believe, unless it’s related to this somehow?