New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt platform plugin "windows" #2

Open
mottosso opened this Issue Sep 18, 2014 · 32 comments

Comments

Projects
None yet
9 participants
@mottosso
Member

mottosso commented Sep 18, 2014

Cannot instantiate a QApplication.

import sys
from PyQt5 import QtWidgets

app = QtWidgets.QApplication(sys.argv)

Results in:

This application failed to start because it could not find or load the Qt platfo
rm plugin "windows".

Available platform plugins are: minimal (from C:\Python27\lib\site-packages\PyQt
5\plugins\platforms), offscreen (from C:\Python27\lib\site-packages\PyQt5\plugin
s\platforms), windows (from C:\Python27\lib\site-packages\PyQt5\plugins\platform
s).

Reinstalling the application may fix this problem.

Having encountered the problem in the past, I could solve it by appending the plugins by hand like this:

import os
import sys

import PyQt5

dirname = os.path.dirname(PyQt5.__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path

from PyQt5 import QtWidgets
app = QtWidgets.QApplication(sys.argv)

However this produces the same error. The odd thing is that it says it can't load the plugin, and then lists the plugin as one of the available ones. Maybe a permission issue? Yet permissions on the files are unlocked and even replacing it with the source original from the Qt installation yields the same results. Removing the plugin from the directory correctly removes it from plugins found.

depends.exe

Running depends on qwindows.dll yields a few interesting results.

depends

However each of these are available directly within the PyQt5 Python package directory.

It works

If keeping the original installation of Qt on the PATH, PyQt5 seems to work. From a terminal:

# Keeping C:\Qt\Qt5.3.0\5.3\msvc2013_64\bin on the PATH

import os
import sys

from PyQt5 import QtWidgets
app = QtWidgets.QApplication(sys.argv)
button = QtWidgets.QPushButton("Hello World")
button.show()

So there must be something within this directory which is requited by PyQt5. But copying the entire contents into the PyQt5 Python library directory yields no better results.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Sep 18, 2014

I've had the same issue with cx_Freeze - there for me it helped to copy libEGL.dll to the frozen package.

Maybe that helps in some way?

The-Compiler commented Sep 18, 2014

I've had the same issue with cx_Freeze - there for me it helped to copy libEGL.dll to the frozen package.

Maybe that helps in some way?

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso Sep 18, 2014

Member

Thanks @The-Compiler, I'll have a look at that tonight. You're thinking of just putting it in the root PyQt5 Python library directory?

Member

mottosso commented Sep 18, 2014

Thanks @The-Compiler, I'll have a look at that tonight. You're thinking of just putting it in the root PyQt5 Python library directory?

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Sep 18, 2014

I'm afraid I have no idea what to do with it (and I don't know anything about putting C projects on PyPI at all), but that's where I remember the message from (with windows being listed in the available platforms as well).

The-Compiler commented Sep 18, 2014

I'm afraid I have no idea what to do with it (and I don't know anything about putting C projects on PyPI at all), but that's where I remember the message from (with windows being listed in the available platforms as well).

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso Sep 18, 2014

Member

I'm afraid I have no idea what to do with it

No problem, it does help to narrow down the dependencies and this seems to be one of them.

(and I don't know anything about putting C projects on PyPI at all

Though I'm sure there are practices for doing this more gracefully, the way I'll handle it initially is the same as with any Python package with package data; to simply include all non-Python files in the package_data argument of setup().

Member

mottosso commented Sep 18, 2014

I'm afraid I have no idea what to do with it

No problem, it does help to narrow down the dependencies and this seems to be one of them.

(and I don't know anything about putting C projects on PyPI at all

Though I'm sure there are practices for doing this more gracefully, the way I'll handle it initially is the same as with any Python package with package data; to simply include all non-Python files in the package_data argument of setup().

mottosso added a commit that referenced this issue Sep 29, 2014

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso Sep 29, 2014

Member

Seems to work now.

Here are the changes:

  • Compiled using Qt 5.3.1 rather than 5.3.2 as it isn't yet supported
  • Binaries was coming from the Python 3 binaries supplied via Riverbank's website but are now coming directly from the Qt distribution.
  • __init__.py now initialises PATH and QT_QPA_PLATFORM_PLUGIN_PATH

Platform plug-ins

The Riverbank distribution ships with a qt.conf which initialises the PATH and platform plugin path, this release instead initialises these via the __init__.py so as to not need to provide the qt.conf file.

Pre-requisities

To run this VS2013 compiled release of PyQt5, you'll need the VS2013 redistributables.

Member

mottosso commented Sep 29, 2014

Seems to work now.

Here are the changes:

  • Compiled using Qt 5.3.1 rather than 5.3.2 as it isn't yet supported
  • Binaries was coming from the Python 3 binaries supplied via Riverbank's website but are now coming directly from the Qt distribution.
  • __init__.py now initialises PATH and QT_QPA_PLATFORM_PLUGIN_PATH

Platform plug-ins

The Riverbank distribution ships with a qt.conf which initialises the PATH and platform plugin path, this release instead initialises these via the __init__.py so as to not need to provide the qt.conf file.

Pre-requisities

To run this VS2013 compiled release of PyQt5, you'll need the VS2013 redistributables.

@mottosso mottosso closed this Sep 29, 2014

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso Feb 5, 2015

Member

This problem re-surfaces in certain situations that I am unable to re-produce.

image

The above was reported by @davidmartinezanim on a Windows 7 machine, running Python 2.7.9 x64 with Visual C++ 2013 re-distributable installed.

Member

mottosso commented Feb 5, 2015

This problem re-surfaces in certain situations that I am unable to re-produce.

image

The above was reported by @davidmartinezanim on a Windows 7 machine, running Python 2.7.9 x64 with Visual C++ 2013 re-distributable installed.

@mottosso mottosso reopened this Feb 5, 2015

@ethanhs

This comment has been minimized.

Show comment
Hide comment
@ethanhs

ethanhs May 23, 2015

I am having the same error with Python 2.7.9 x64 on Windows 8. I just freshly installed. Looking through the qt forums this is a problem for qt apps too. I have read that the app needs to have qt.conf and the platforms folder in its path. I'll check this later today or tomorrow.

ethanhs commented May 23, 2015

I am having the same error with Python 2.7.9 x64 on Windows 8. I just freshly installed. Looking through the qt forums this is a problem for qt apps too. I have read that the app needs to have qt.conf and the platforms folder in its path. I'll check this later today or tomorrow.

@ethanhs

This comment has been minimized.

Show comment
Hide comment
@ethanhs

ethanhs May 24, 2015

Well, I have a similar but slightly different problem. The windows platform option (or any option for that matter) doesn't show up at all. Interestingly, your above method of adding the os.environ value worked. The weird part is that setx QT_QPA_PLATFORM_PLUGIN_PATH "C:\Python27\lib\site-packages\PyQt 5\plugins\platforms" didn't work at all. I couldn't call the variable from cmd like PATH, and it didn't work with a Python script. Very weird.

ethanhs commented May 24, 2015

Well, I have a similar but slightly different problem. The windows platform option (or any option for that matter) doesn't show up at all. Interestingly, your above method of adding the os.environ value worked. The weird part is that setx QT_QPA_PLATFORM_PLUGIN_PATH "C:\Python27\lib\site-packages\PyQt 5\plugins\platforms" didn't work at all. I couldn't call the variable from cmd like PATH, and it didn't work with a Python script. Very weird.

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso May 24, 2015

Member

If you are installing from GitHub, and not PyPI, then you should have 5.4. If you do, have a go with this to see if it changes anything.

https://github.com/pyqt/python-qt5/wiki/Installation#install

It will create a qt.conf for you with the appropriate settings for your system.

To check the version of PyQt, try this.

>>> import PyQt5
>>> PyQt5.pyqt_version
'5.3.2'
Member

mottosso commented May 24, 2015

If you are installing from GitHub, and not PyPI, then you should have 5.4. If you do, have a go with this to see if it changes anything.

https://github.com/pyqt/python-qt5/wiki/Installation#install

It will create a qt.conf for you with the appropriate settings for your system.

To check the version of PyQt, try this.

>>> import PyQt5
>>> PyQt5.pyqt_version
'5.3.2'
@ethanhs

This comment has been minimized.

Show comment
Hide comment
@ethanhs

ethanhs May 24, 2015

I installed from Github. I actually followed the steps you are pointing to, and I still got the error. Interesting. I just ran it again from the downloaded directory, and that might have fixed it. So maybe an extra step of running it again? Or just running it after install?

Well, I just re-installed from Github, and it worked if I ran the qt.conf generator after running python setup.py install. Very strange.

ethanhs commented May 24, 2015

I installed from Github. I actually followed the steps you are pointing to, and I still got the error. Interesting. I just ran it again from the downloaded directory, and that might have fixed it. So maybe an extra step of running it again? Or just running it after install?

Well, I just re-installed from Github, and it worked if I ran the qt.conf generator after running python setup.py install. Very strange.

@ethanhs

This comment has been minimized.

Show comment
Hide comment
@ethanhs

ethanhs May 30, 2015

It got weirder. I just got the message again. I tried generating a qt.conf again, but that didn't work. This is very annoying.

EDIT: and it is back. Perhaps re-running python -c "import util;util.createqtconf()"did work. I think I just needed to restart my ide. I am starting to think this is a valid solution.

ethanhs commented May 30, 2015

It got weirder. I just got the message again. I tried generating a qt.conf again, but that didn't work. This is very annoying.

EDIT: and it is back. Perhaps re-running python -c "import util;util.createqtconf()"did work. I think I just needed to restart my ide. I am starting to think this is a valid solution.

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso May 31, 2015

Member

The behaviour is that Qt looks for qt.conf in the same directory as the current executable. Have a look at what executable your IDE is actually launching, it might be different from c:\Python27\python.exe. I've heard of this happening with PyCharm, for example, when running in debug versus release mode.

You can print the current executable like this.

import sys
print sys.executable

There should be a qt.conf in the same directory, and it should contain lines pointing to where your PyQt5 installation is at.

It can get really complicated, so I don't blame you for getting frustrated. I've been there. :(

See the Bundling section of the wiki here for the full story.

Member

mottosso commented May 31, 2015

The behaviour is that Qt looks for qt.conf in the same directory as the current executable. Have a look at what executable your IDE is actually launching, it might be different from c:\Python27\python.exe. I've heard of this happening with PyCharm, for example, when running in debug versus release mode.

You can print the current executable like this.

import sys
print sys.executable

There should be a qt.conf in the same directory, and it should contain lines pointing to where your PyQt5 installation is at.

It can get really complicated, so I don't blame you for getting frustrated. I've been there. :(

See the Bundling section of the wiki here for the full story.

@ethanhs

This comment has been minimized.

Show comment
Hide comment
@ethanhs

ethanhs May 31, 2015

Okay, I am using PyCharm, but I am using Python27's python.exe (checked using your code). I think I have the problem. I was running python -c "import util;util.createqtconf()" from the downloaded directory, so all of the path information was pointing to Downloads\python-qt5, instead of the one in site-packages. I am not sure about the qt.conf. It currently is pointing to Lib\site-packages\PyQt5.

So having the install directory solved this issue, but raised another, it is trying to find my QtQml dll in my downloads (which doesn't exist).

EDIT: And none of the potential answers have done anything. I think I might need to poke around in my PATH and make sure things are pointing to the right places.

EDIT2: Still nothing. I have my PATH pointing towards the right folders, but I still have the problem.

ethanhs commented May 31, 2015

Okay, I am using PyCharm, but I am using Python27's python.exe (checked using your code). I think I have the problem. I was running python -c "import util;util.createqtconf()" from the downloaded directory, so all of the path information was pointing to Downloads\python-qt5, instead of the one in site-packages. I am not sure about the qt.conf. It currently is pointing to Lib\site-packages\PyQt5.

So having the install directory solved this issue, but raised another, it is trying to find my QtQml dll in my downloads (which doesn't exist).

EDIT: And none of the potential answers have done anything. I think I might need to poke around in my PATH and make sure things are pointing to the right places.

EDIT2: Still nothing. I have my PATH pointing towards the right folders, but I still have the problem.

@jacksonofalltrades

This comment has been minimized.

Show comment
Hide comment
@jacksonofalltrades

jacksonofalltrades Jan 18, 2016

Just to clarify, this package does not require me to install Qt 5 as a dependency for this? It looks like python-qt5 includes all the necessary DLLs? Am I getting that right? Thanks!

jacksonofalltrades commented Jan 18, 2016

Just to clarify, this package does not require me to install Qt 5 as a dependency for this? It looks like python-qt5 includes all the necessary DLLs? Am I getting that right? Thanks!

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso Jan 19, 2016

Member

That's right!

Member

mottosso commented Jan 19, 2016

That's right!

@jacksonofalltrades

This comment has been minimized.

Show comment
Hide comment
@jacksonofalltrades

jacksonofalltrades Jan 27, 2016

So I got this to work before, and now it's not working again :(

PyInstaller Bootloader 3.x
LOADER: executable is Q:\exec\win\dist\main\main.exe
LOADER: homepath is Q:\exec\win\dist\main
LOADER: _MEIPASS2 is NULL
LOADER: archivename is Q:\exec\win\dist\main\main.exe
LOADER: No need to extract files to run; setting extractionpath to homepath
LOADER: SetDllDirectory(Q:\exec\win\dist\main)
LOADER: Already in the child - running user's code.
LOADER: Python library: Q:\exec\win\dist\main\python27.dll
LOADER: Loaded functions from Python library.
LOADER: Manipulating environment (sys.path, sys.prefix)
LOADER: sys.prefix is Q:\exec\win\dist\main
LOADER: Setting runtime options
LOADER: Initializing python
LOADER: Overriding Python's sys.path
LOADER: Post-init sys.path is Q:\exec\win\dist\main
LOADER: Setting sys.argv
LOADER: setting sys._MEIPASS
LOADER: importing modules from CArchive
LOADER: extracted struct
LOADER: callfunction returned...
LOADER: extracted pyimod01_os_path
LOADER: callfunction returned...
LOADER: extracted pyimod02_archive
LOADER: callfunction returned...
LOADER: extracted pyimod03_importers
LOADER: callfunction returned...
LOADER: Installing PYZ archive with Python modules.
LOADER: PYZ archive: out00-PYZ.pyz
LOADER: Running pyiboot01_bootstrap.py
LOADER: Running pyi_rth_qt5.py
Qt: Untested Windows version 10.0 detected!
LOADER: Running pyi_rth_qt5plugins.py
LOADER: Running pyi_rth_win32comgenpy.py
LOADER: Running main.py
RUNNING SMARTSHARE: Q:\exec\win\dist\main\PyQt5\plugins\platforms
This application failed to start because it could not find or load the Qt platform plugin "windows".

Here is what I did:

  1. I used the git clone directly to get PyQt version 5.4.0
  2. I put this line at the very top of my script before Qt is used:
    import sys; import os; os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = os.path.join(sys._MEIPASS, 'PyQt5', 'plugins', 'platforms')
  3. I removed the qt.conf files from the pyinstaller dist folder
  4. I checked that the pyinstaller dist folder did indeed have PyQt5/plugins/platforms with a qwindows.dll in it.

I'm really desperate at this point. This worked on a Windows Server VM, but is not working on Windows 10 64-bit.

Any assistance would be greatly appreciated!

jacksonofalltrades commented Jan 27, 2016

So I got this to work before, and now it's not working again :(

PyInstaller Bootloader 3.x
LOADER: executable is Q:\exec\win\dist\main\main.exe
LOADER: homepath is Q:\exec\win\dist\main
LOADER: _MEIPASS2 is NULL
LOADER: archivename is Q:\exec\win\dist\main\main.exe
LOADER: No need to extract files to run; setting extractionpath to homepath
LOADER: SetDllDirectory(Q:\exec\win\dist\main)
LOADER: Already in the child - running user's code.
LOADER: Python library: Q:\exec\win\dist\main\python27.dll
LOADER: Loaded functions from Python library.
LOADER: Manipulating environment (sys.path, sys.prefix)
LOADER: sys.prefix is Q:\exec\win\dist\main
LOADER: Setting runtime options
LOADER: Initializing python
LOADER: Overriding Python's sys.path
LOADER: Post-init sys.path is Q:\exec\win\dist\main
LOADER: Setting sys.argv
LOADER: setting sys._MEIPASS
LOADER: importing modules from CArchive
LOADER: extracted struct
LOADER: callfunction returned...
LOADER: extracted pyimod01_os_path
LOADER: callfunction returned...
LOADER: extracted pyimod02_archive
LOADER: callfunction returned...
LOADER: extracted pyimod03_importers
LOADER: callfunction returned...
LOADER: Installing PYZ archive with Python modules.
LOADER: PYZ archive: out00-PYZ.pyz
LOADER: Running pyiboot01_bootstrap.py
LOADER: Running pyi_rth_qt5.py
Qt: Untested Windows version 10.0 detected!
LOADER: Running pyi_rth_qt5plugins.py
LOADER: Running pyi_rth_win32comgenpy.py
LOADER: Running main.py
RUNNING SMARTSHARE: Q:\exec\win\dist\main\PyQt5\plugins\platforms
This application failed to start because it could not find or load the Qt platform plugin "windows".

Here is what I did:

  1. I used the git clone directly to get PyQt version 5.4.0
  2. I put this line at the very top of my script before Qt is used:
    import sys; import os; os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = os.path.join(sys._MEIPASS, 'PyQt5', 'plugins', 'platforms')
  3. I removed the qt.conf files from the pyinstaller dist folder
  4. I checked that the pyinstaller dist folder did indeed have PyQt5/plugins/platforms with a qwindows.dll in it.

I'm really desperate at this point. This worked on a Windows Server VM, but is not working on Windows 10 64-bit.

Any assistance would be greatly appreciated!

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso Jan 27, 2016

Member

Why step 3? I think you may need a qt.conf and it needs to reside next to the executable.

Member

mottosso commented Jan 27, 2016

Why step 3? I think you may need a qt.conf and it needs to reside next to the executable.

@jacksonofalltrades

This comment has been minimized.

Show comment
Hide comment
@jacksonofalltrades

jacksonofalltrades Jan 27, 2016

Given what I said above, what paths should be in the qt.conf? That is, what are the paths in qt.conf relative to? Also, do the slashes need to be Windows-style (backslashes)? Also, is it a problem to have both the qt.conf and the env var setting line in my python code?

Ok, this is interesting. On the other Windows machine, after installing python-qt5 from git, it just worked in a python shell without any mucking with env vars or qt.conf. But on this machine, even doing the test in the original post on this thread didn't work, much less through pyinstaller.

jacksonofalltrades commented Jan 27, 2016

Given what I said above, what paths should be in the qt.conf? That is, what are the paths in qt.conf relative to? Also, do the slashes need to be Windows-style (backslashes)? Also, is it a problem to have both the qt.conf and the env var setting line in my python code?

Ok, this is interesting. On the other Windows machine, after installing python-qt5 from git, it just worked in a python shell without any mucking with env vars or qt.conf. But on this machine, even doing the test in the original post on this thread didn't work, much less through pyinstaller.

@jacksonofalltrades

This comment has been minimized.

Show comment
Hide comment
@jacksonofalltrades

jacksonofalltrades Jan 27, 2016

I'm really stumped and very late on this project. Can I pay you to give me phone support or something?

jacksonofalltrades commented Jan 27, 2016

I'm really stumped and very late on this project. Can I pay you to give me phone support or something?

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso Jan 27, 2016

Member

Oh shit, sorry I've just head to bed over here.

There is a pretty good overview in the Qt docs about what should be in the qt.conf, but in general there should only need to be one path pointing to the main PyQt5 dir, containing all the dlls and exes. i think it was the bin path, but can't be sure and can't look it up as I'm quite indisposed at the moment.

Also its worth noting that the problem is not unique to this distribution or even PyQt, so all help on qt.conf, including that about C++, also applies here.

Also have a look at the wiki here, there's a page on updating this repo which includes a section about bundling.

Good luck and I'll try and have a look here again in the morning!

Member

mottosso commented Jan 27, 2016

Oh shit, sorry I've just head to bed over here.

There is a pretty good overview in the Qt docs about what should be in the qt.conf, but in general there should only need to be one path pointing to the main PyQt5 dir, containing all the dlls and exes. i think it was the bin path, but can't be sure and can't look it up as I'm quite indisposed at the moment.

Also its worth noting that the problem is not unique to this distribution or even PyQt, so all help on qt.conf, including that about C++, also applies here.

Also have a look at the wiki here, there's a page on updating this repo which includes a section about bundling.

Good luck and I'll try and have a look here again in the morning!

@jacksonofalltrades

This comment has been minimized.

Show comment
Hide comment
@jacksonofalltrades

jacksonofalltrades commented Jan 27, 2016

Ok, thank you!

@jacksonofalltrades

This comment has been minimized.

Show comment
Hide comment
@jacksonofalltrades

jacksonofalltrades Jan 27, 2016

Ok, I think I figured it out. I had to use 5.3.2, hopefully that'll work for what I need...

jacksonofalltrades commented Jan 27, 2016

Ok, I think I figured it out. I had to use 5.3.2, hopefully that'll work for what I need...

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso Jan 28, 2016

Member

Phew, glad to hear it worked out. :) Don't know what the difference is between the two versions, they should be identical, but I'll keep an eye out.

Member

mottosso commented Jan 28, 2016

Phew, glad to hear it worked out. :) Don't know what the difference is between the two versions, they should be identical, but I'll keep an eye out.

@ruidc

This comment has been minimized.

Show comment
Hide comment
@ruidc

ruidc Jun 20, 2016

setting QT_QPA_PLATFORM_PLUGIN_PATH works for me with 5.4.0

ruidc commented Jun 20, 2016

setting QT_QPA_PLATFORM_PLUGIN_PATH works for me with 5.4.0

@stevengj

This comment has been minimized.

Show comment
Hide comment
@stevengj

stevengj Feb 4, 2017

I just ran into this when using libpython embedded in another program (for the PyCall package that lets us call Python from the Julia language). Since the executable was not running from the python.exe directory (and in fact, was not running python.exe at all), it was not finding the qt.conf file.

To improve the situation for "embedded" libpython users, instead of looking at the directory of the current executable, would you consider defaulting to sys.exec_prefix? (Or is it using sys.executable now?)

stevengj commented Feb 4, 2017

I just ran into this when using libpython embedded in another program (for the PyCall package that lets us call Python from the Julia language). Since the executable was not running from the python.exe directory (and in fact, was not running python.exe at all), it was not finding the qt.conf file.

To improve the situation for "embedded" libpython users, instead of looking at the directory of the current executable, would you consider defaulting to sys.exec_prefix? (Or is it using sys.executable now?)

@stevengj

This comment has been minimized.

Show comment
Hide comment
@stevengj

stevengj Feb 4, 2017

(Note that on most platforms an embedding program can set sys.executable to be the location of python by calling Py_SetProgramName, but on Windows Python ignores this and always uses the name of the running program via GetModuleFileNameW. So, sys.executable is a problematic way to find qt.conf for embedded Python callers.)

stevengj commented Feb 4, 2017

(Note that on most platforms an embedding program can set sys.executable to be the location of python by calling Py_SetProgramName, but on Windows Python ignores this and always uses the name of the running program via GetModuleFileNameW. So, sys.executable is a problematic way to find qt.conf for embedded Python callers.)

@stevengj

This comment has been minimized.

Show comment
Hide comment
@stevengj

stevengj Feb 4, 2017

Hmm, I guess this is not under PyQt's control, since the location where qt.conf is loaded is set by Qt itself.

stevengj commented Feb 4, 2017

Hmm, I guess this is not under PyQt's control, since the location where qt.conf is loaded is set by Qt itself.

@mottosso

This comment has been minimized.

Show comment
Hide comment
@mottosso

mottosso Feb 6, 2017

Member

That's right. qt.conf is entirely under the control of the Qt run-time and associated environment variables.

Member

mottosso commented Feb 6, 2017

That's right. qt.conf is entirely under the control of the Qt run-time and associated environment variables.

@stevengj

This comment has been minimized.

Show comment
Hide comment
@stevengj

stevengj Feb 6, 2017

Unfortunately, there seems to be no environment variable to tell it an alternate location from which to load qt.conf. I filed a Qt issue so that hopefully they can improve this, but for now we are parsing qt.conf ourselves and then using it to set the QT_PLUGIN_PATH environment variable.

stevengj commented Feb 6, 2017

Unfortunately, there seems to be no environment variable to tell it an alternate location from which to load qt.conf. I filed a Qt issue so that hopefully they can improve this, but for now we are parsing qt.conf ourselves and then using it to set the QT_PLUGIN_PATH environment variable.

@martinpengellyphillips

This comment has been minimized.

Show comment
Hide comment
@martinpengellyphillips

martinpengellyphillips Jun 2, 2017

On a related note; I installed into a Virtualenv and had to move qt.conf from /path/to/virtualenv/ to /path/to/virtualenv/Scripts. I then updated contents to the following and it worked after that:

[Paths]
Prefix = ../Lib/site-packages/PyQt5
Binaries = ../Lib/site-packages/PyQt5

martinpengellyphillips commented Jun 2, 2017

On a related note; I installed into a Virtualenv and had to move qt.conf from /path/to/virtualenv/ to /path/to/virtualenv/Scripts. I then updated contents to the following and it worked after that:

[Paths]
Prefix = ../Lib/site-packages/PyQt5
Binaries = ../Lib/site-packages/PyQt5
@oneextrafact

This comment has been minimized.

Show comment
Hide comment
@oneextrafact

oneextrafact Sep 7, 2017

I ran into this after trying to start my debugger in PyCharm after a Windows 10 upgrade. I tried everything here but no luck, but it did go away after I installed the "Unofficial PyQt5 via PyPI for Python 2.7 64-bit on Windows" here.

oneextrafact commented Sep 7, 2017

I ran into this after trying to start my debugger in PyCharm after a Windows 10 upgrade. I tried everything here but no luck, but it did go away after I installed the "Unofficial PyQt5 via PyPI for Python 2.7 64-bit on Windows" here.

@seghier

This comment has been minimized.

Show comment
Hide comment
@seghier

seghier Oct 9, 2017

pyinstaller give me the same error

seghier commented Oct 9, 2017

pyinstaller give me the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment