In my case, I had Windows 10 32-bits and Python 3.7.2.
Using PyQt5 5.11 installed via pip I got this error:
from PyQt5.QtWidgets import QApplication
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
I noticed that version 5.11 came without Qt DLLs, so I reinstalled an earler version with
python -m pip uninstall PyQt5
and python -m pip install PyQt5==5.10
Never use --no-cache-dir since it will produce an assert error when installing the whl file:
assert building_is_possible
assertion Error
I ended up installing 5.10 and had the following error:
qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
After setting QT_DEBUG_PLUGINS and even plugin path with:
set QT_DEBUG_PLUGINS=
set QT_PLUGIN_PATH=C:\Python37-32\Lib\site-packages\PyQt5\Qt\plugins
I realised that the dll qwindows.dll was searched in the right path where it resides.
TL;DR: I re-ran my python Qt script with UAC elevation, and guess what, it worked !
conda install --channel https://conda.anaconda.org/bpentz pyqt5
and didn't get the error. – Grouppip list
? – ApographPyQt5.__file__
to get the location conda put it. then go to a command prompt, and after installing 5.8.1 with pip, callpip show pyqt5
and compare the location to that of 5.6 you installed with conda. If the path to /site-packages/ is different, you have multiple separate installations. – ApographContinuum\\Anaconda3\\lib\\site-packages\\PyQt5\\__init__.py
– Group