Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in
read-only mode
.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Anaconda:
Anaconda3-2022.05-Windows-x86_64
vitual environment: base,PyQt6
The output of the command
pip list
when the virtual environment is "PyQt6":
Package Version
---------------- ---------
click 7.1.2
pip 21.3.1
PyQt6 6.1.0
pyqt6-plugins 6.1.0.2.2
PyQt6-Qt6 6.3.1
PyQt6-sip 13.4.0
pyqt6-tools 6.1.0.3.2
python-dotenv 0.20.0
qt6-applications 6.1.0.2.2
qt6-tools 6.1.0.1.2
setuptools 60.5.0
wheel 0.37.1
The output of the command pip list|findstr "Qt"
when the virtual environment is "base"PyQt6 6.3.1
PyQt6-Qt6 6.3.1
PyQt6-sip 13.4.0
QtAwesome 1.0.3
QtPy 2.0.1
The issue
When the vritual environment is "PyQt6", the code from PyQt6 import QtWidgets
throws the error below
DLL load failed while importing QtGui: The specified procedure could not be found.
But, when the vritual environment is "base", the code runs normally
Why?How to solve it?
Another test
First step, create a brand-new virtual environment, and then install PyQt6
conda create -n PyQt6_2 python=3.9.9
conda activate PyQt6_2
pip install PyQt6
Then, test the code from PyQt6 import QtWidgets
Python
>> from PyQt6 import QtWidgets
Everything runs fine now.
Second step, install PyQt6-tools
pip install PyQt6-tools
Then, the code from PyQt6 import QtWidgets
will throw the error PyQt6: DLL load failed while importing QtGui: The specified procedure could not be found.
Comparsion
Before I installed PyQt6
, the output of pip list
was
Package Version
---------- -------
pip 21.3.1
PyQt6 6.3.1
PyQt6-Qt6 6.3.1
PyQt6-sip 13.4.0
setuptools 60.5.0
wheel 0.37.1
After I installed PyQt6
, the output of pip list
was
Package Version
---------------- ---------
click 7.1.2
pip 21.3.1
PyQt6 6.1.0
pyqt6-plugins 6.1.0.2.2
PyQt6-Qt6 6.3.1
PyQt6-sip 13.4.0
pyqt6-tools 6.1.0.3.2
python-dotenv 0.20.0
qt6-applications 6.1.0.2.2
qt6-tools 6.1.0.1.2
setuptools 60.5.0
wheel 0.37.1
The tests on base
and PyQt6
virtual environments are the same with this test.
In the first test, the virtual environment base
installed PyQt6
and not installed PyQt6-tools
the problem starts on PyQt version 6.0.3. Do not install other modules that depends on the version above 6.03. I solve the issue by installing PyQt 6.0.2 and pyqt6-tools 6.0.2
my version list is the following
Package Version
click 7.1.2
pip 21.3.1
PyQt6 6.0.2
pyqt6-plugins 6.0.2.2.2
PyQt6-Qt 6.0.1
PyQt6-Qt6 6.0.2
PyQt6-sip 13.4.0
pyqt6-tools 6.0.2.3.2
python-dotenv 0.20.0
qt6-applications 6.0.2.2.2
qt6-tools 6.0.2.1.2
setuptools 60.2.0
wheel 0.37.1