DLL负载在虚拟环境中在PYQT5中失败

发布于 2025-02-07 01:32:38 字数 2139 浏览 0 评论 0原文

我知道在 1 中,已经提出了一些解决方案。 /Q/47739191/13349539“> 2 和 3 。我尝试了几乎所有。 我尝试过:

这些似乎都没有用,所以我试图运行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.

10

11

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文