[PyQt] PyQt5 for Python 2.7 on Windows 10

Nathan Warmerdam nbwarmerdam at integrated-informatics.com
Wed May 31 01:30:33 BST 2017


Hello All,

I have built (with commercial license) PyQt5 for python 2.7.  I used VS 2015 and packaged my build with what I believe to be the appropriate windows redistributables.

With the resulting build I have had success getting it to run on an independent (i.e. not the build machine) Windows 8.1 machine.

However when attempting to get it to run on a Windows 10 I have run into the dreaded:
This application failed to start because it could not find or load the Qt platform plugin “windows”

This is usually a sign that the qt.conf is bad but why would it work on Windows 8 but not Windows 10?  Furthermore it does not work even if I put a qt.conf file right next to the python.exe.

I have followed the file structure used by Phil in the Python 3 version of PyQt5 (e.g. PyQt5\Qt\bin and PyQt5\plugins, etc) and modified the __init__.py file to set various environment variables.  Like this:

import os
import sys
dir_name = os.path.dirname(__file__)

_path = os.path.dirname(__file__) + '\\Qt\\bin;' + os.environ['PATH']
os.environ['PATH'] = _path

os.environ['QML_IMPORT_PATH'] = os.path.join(dir_name, 'Qt', 'qml')
os.environ['QML2_IMPORT_PATH'] = os.path.join(dir_name, 'Qt', 'qml')

os.environ['QT_PLUGIN_PATH'] = os.path.join(dir_name, 'Qt', 'plugins')

os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = os.path.join(dir_name, 'Qt', 'plugins', 'platforms')

However the message persists.

As I said, it works on independent Windows 8.1 machines but not with Windows 10.  Does anyone have any tips or experience or success with PyQt5 for python 2.7 on Windows 10?

With respect,
Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170531/bcf6b32b/attachment.html>


More information about the PyQt mailing list