Python Ships in Unreal Engine 4.19
ADDING THE PLUGIN
For anyone with version 4.19 of the engine or later, you now have access to Python. It’s marked ‘experimental’, enable it under plugins:
You then can enter python through the command line:
As the Python implementation wraps blueprint and blutilities, you only have access to things exposed through blueprint.
INSTALLING THIRD PARTY LIBRARIES
The team has made it a lot easier to install 3rd party libraries by shipping with pip.exe, it’s in this folder: <build>\Engine\Source\ThirdParty\Python\Win64\Scripts
Here’s an example of installing PySide into the build:
>>pip install --target=Y:\Build\UE_4.19\Engine\Source\ThirdParty\Python\Win64\Lib\site-packages Pyside Collecting Pyside Using cached PySide-1.2.4-cp27-none-win_amd64.whl Installing collected packages: Pyside Successfully installed Pyside-1.2.4 |
[…] This requires PySide, you can pip install that, I gave an example in my previous post, here. […]
Pingback by Stumbling Toward 'Awesomeness'ScriptWrangler: A light-weight script editor for Python environments - Stumbling Toward 'Awesomeness' — 2018/04/03 @ 2:29 PM
Your example of installing PySide in Unreal 4.19 gives me an error:
Error: SyntaxError: invalid syntax (, line 1)
Do you have an idea or solution?
Comment by Gerti — 2018/06/20 @ 9:00 AM
Hey Chris,
Thanks for all of this! Could you give any more details on how you installed PySide? Did you run pip from inside the editor? If so, how? I’m getting Win32 application / DLL load errors when I try to install it.
Thanks!
Comment by Phil Boltt — 2018/08/17 @ 3:34 PM
Hey Chris, cool blog post. I tried installing PySide on unreal 4.20, here are some glimpses :
– you can update pip after an “import pip” by using
pip.main([‘install’, ‘–upgrade’, ‘pip’]) . However this command won’t work after updating
– You can install PySide package in the sitesPackage from an usual command line (external to Unreal), however it will raise some errors once QtPy is needed
LogPython: Error: File “…\myStandaloneApp.py”, line 10, in
LogPython: Error: from Qtpy.Qt import QtGui, QtCore, QtWidgets
LogPython: Error: File “…\Qtpy\Qt.py”, line 1110, in
LogPython: Error: _install()
LogPython: Error: File “…\Qtpy\Qt.py”, line 1107, in _install
LogPython: Error: Qt.QtCompat.load_ui = Qt.QtCompat.loadUi
LogPython: Error: AttributeError: ‘module’ object has no attribute ‘loadUi’
Comment by Sebastien MARAUX — 2018/08/30 @ 12:22 PM