20tab / UnrealEnginePython

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

This application failed to start because no Qt platform plugin could be initialized #787

Closed Schizo closed 5 years ago

Schizo commented 5 years ago

I had a working version of system python 3.6 and the PySide2 module without erros. However, to check out if the unreal native python works as well (which is Python2) I have installed PyQt4 in unreals python 2.7 interpreter through pip. However not satisfied with Unreal Engine's python I wanted to go back to tab20 UEPlugin but started getting that error message when running the beneath code.

from PySide2.QtWidgets import QApplication
app = QApplication()

So to start a clean sheet I've

1) Installed embedded python (3.6 for 4.20) 2) Then used the command from the Plugins\UnrealEnginePython\Binaries\Win64\python install --target . PySide2

However that gives me again the same error as above.

Interestingly, when i just launch the python interpreter from the Plugin's directory the above code works fine.

Any help/hint appreciated.

Schizo commented 5 years ago

I've kind of a workaround to it, but I don't think it's the best Idea. I've added a new environment variable: QT_PLUGIN_PATH with the string *UnrealEnginePython\Binaries\Win64\Lib\site-packages\PySide2\plugins

That shouldn't be necessary,

Schizo commented 5 years ago

Closing this, as the issue is indirectly solved.