DLL负载在虚拟环境中在PYQT5中失败
我知道在 1 中,已经提出了一些解决方案。 /Q/47739191/13349539“> 2 和 3 。我尝试了几乎所有。 我尝试过:
- 使用文件 4
- 解开和安装不同版本的Pyqt5和Pyqt5-Tools href =“ https://stackoverflow.com/a/51422398/13349539”> 5 , 6 6
- 还尝试将python3.dll从python文件夹复制到虚拟环境中的脚本文件夹 7 https://stackoverflow.com/a/47143737/13349539"> 8
这些似乎都没有用,所以我试图运行pyqt5,我已经有一个.UI文件,我想运行它,我想运行它,但这一直给我带来错误。我的计算机是Windows 10
File ".\test.py", line 1, in <module> from PyQt5 import QtWidgets, uic
ImportError: DLL load failed: The specified module could not be found.
这是test.py文件:
from PyQt5 import QtWidgets, uic
import sys
app = QtWidgets.QApplication([])
win = uic.loadUi("User_Interface.ui") #specify the location of your .ui file
win.show()
sys.exit(app.exec())
我在具有命令python test.py
已安装的软件包如下(使用pip list
命令):
click 6.7
packaging 21.3
pip 20.1.1
ply 3.11
pyparsing 3.0.9
PyQt5 5.9
pyqt5-tools 5.9.2.1.3
python-dotenv 0.20.0
setuptools 47.1.0
sip 4.19.8
toml 0.10.2
此解决方案 9 建议将C ++运行时环境升级到2015-2019,但我已经有了。
如果需要更多信息,我会很乐意为它们提供。 任何帮助都非常感谢。
如果PYQT5在计算机上正常工作,您可以说明已安装的软件包和版本,以便我可以重新创建您的虚拟环境
I am aware that some solutions for this have been suggested in 1, 2, and 3. I tried almost all of them.
I tried:
- Running the pyuic5 using absolute paths for the file 4
- Uninstalling and installing different versions of pyqt5 and pyqt5-tools 5, 6
- I also tried copying the python3.dll from the python folder to the Scripts folder in the virtual environment 7, 8
None of these seemed to work, so I am trying to run PyQt5, I already have a .UI file and I would like to run it, but it keeps giving me the error. My machine is Windows 10
File ".\test.py", line 1, in <module> from PyQt5 import QtWidgets, uic
ImportError: DLL load failed: The specified module could not be found.
This is the test.py file:
from PyQt5 import QtWidgets, uic
import sys
app = QtWidgets.QApplication([])
win = uic.loadUi("User_Interface.ui") #specify the location of your .ui file
win.show()
sys.exit(app.exec())
I execute it in a virtual environment that has Python 3.7.9 (this is what appears when i type python -V
) with the command python test.py
The installed packages are the following (using the pip list
command):
click 6.7
packaging 21.3
pip 20.1.1
ply 3.11
pyparsing 3.0.9
PyQt5 5.9
pyqt5-tools 5.9.2.1.3
python-dotenv 0.20.0
setuptools 47.1.0
sip 4.19.8
toml 0.10.2
This solution 9 suggests upgrading the C++ runtime environment to 2015-2019, but I already have that.
If any more information is needed, I'll be happy to provide them.
Any help is more than appreciated.
If PyQt5 works properly on your machine, can you state the packages and versions you have installed, so I can recreate your virtual environment
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论