Error using PySide2 python library in Unreal

Hello to all,

I am trying to create a simple interface using PySide2, however Unreal crashes unexpectedly.

I have already installed the PySide2 library from pip.exe in the UE folder (C:\Program_files\UE_5.3\EngineBinaries\ThirdParty\Python3\Win64\Lib\site-packages).

The code I am trying to run is as simple as this.

import PySide2.QtWidgets as qt
widget = qt.QWidget()
widget.show()

2023-12-09 11-00-42.mkv (3.6 MB)

Greetings @gmdaniel3d

I’d be happy to look into what is causing this issue. Based on the file location I see that this is happening in 5.3. Does this occur in other versions? Also, if you’d be so kind to provide your crash log for this? (Generally stored in C:\Users[Your Windows Username]\AppData\Local[Project Name]\Saved\Crashes) Thanks!

The same thing happens to me with version 5.1, I thought it was a bug in the version and I updated to 5.3 and the same thing happens. Apparently there is an internal error in creating a widget, because it is reading the Pyside2 library.

Thanks for your help, hopefully it can be fixed soon, I’m excited to create tools in Unreal.

python_tools.log (200.6 KB)

Oh, I see! Well, we’re happy to have you in the community and hopefully we’ll see that issue patched/resolved soon. Thanks again for the info!

1 Like

Hello. Was any solution for for this? I found it didn’t happen when Unreal first started getting used but now happens every time. I’ve got exactly the same issue. Its a pretty serious issue as every PySide2 UI crashes Unreal.

from PySide2 import QtWidgets
w = QtWidgets.QWidget()

This crashes immediately with nothing in the crash logs. PySide2 version 5.15.2.1 and Unreal version 5.3.

Thanks very much.

This works:


if not QtWidgets.QApplication.instance():
    app = QtWidgets.QApplication(sys.argv)
else:
    app = QtWidgets.QApplication.instance()
window = QtWidgets.QWidget()
window.show()
app.exec_()
1 Like

This code not works for me :frowning: . I Still have the same problem, the Editor crashed. Any sugestions ?