Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

QT_QPA_PLATFORM_PLUGIN_PATH #69

Closed
fredrikaverpil opened this issue Jul 22, 2017 · 1 comment
Closed

QT_QPA_PLATFORM_PLUGIN_PATH #69

fredrikaverpil opened this issue Jul 22, 2017 · 1 comment

Comments

@fredrikaverpil
Copy link
Owner

fredrikaverpil commented Jul 22, 2017

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 "".

I googled and found the following:

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:

conda create --mkdir -p ~/condaenvs/pyside2_py35 python=3.5 qt=5.2
~/condaenvs/pyside2_py35/bin/pip install <wheel url>
~/condaenvs/pyside2_py35/python ...

I asked in the Gitter PySide2 channel about this...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant