With the current Windows build and without having Qt5 installed locally, I get this error:
>>> import sys
>>> from Qt import QtWidgets
>>> app = QtWidgets.QApplication(sys.argv)
"This application failed to start because it could not find or load the Qt
platform plugin "windows in "".
It seems you need to set QT_QPA_PLATFORM_PLUGIN_PATH to point to your site-packages/PySide2/plugins/platforms in order to successfully run that. This can be done from within Python too:
import os
>>> import sys
>>> from Qt import QtWidgets
>>> os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = os.path.dirname(PySide2.__file__) + '/plugins/platforms'
>>> app = QtWidgets.QApplication(sys.argv)
Or, it works just fine without any extra environment variables if you use the wheel in a conda environment where Qt5 is also installed:
With the current Windows build and without having Qt5 installed locally, I get this error:
I googled and found the following:
It seems you need to set
QT_QPA_PLATFORM_PLUGIN_PATH
to point to yoursite-packages/PySide2/plugins/platforms
in order to successfully run that. This can be done from within Python too:Or, it works just fine without any extra environment variables if you use the wheel in a conda environment where Qt5 is also installed:
I asked in the Gitter PySide2 channel about this...