问题
在下载Python的PyQt5安装包后使用时,你是否遇到过以下问题?
(解决方案看最后)
>>> from PyQt5 import QtCore
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from PyQt5 import QtWidgets
ImportError:DLL load failed:the specified module could not be found.
以下方法建议不要使用……
- 缺少python3.dll,下载即可
下载该.dll文件后依旧报错
- 重新下载PyQt5
重新下载后还是报错
- 用conda下载PyQt5,或建立虚拟环境
用conda下载或建立虚拟环境,不仅没成功,反而conda报错了
真是太令人抓狂了!我在网上翻来翻去,终于找到一个答案……
解决方案
- 下载PyQtWebEngine
Windows:
开始键+R,输入cmd,弹出管理员界面……
Microsoft Windows [Version 10.0.19043.1889]
(c) Microsoft Corporation. All rights reserved.
C:\Users\XX>
在里面输入pip install pyqtwebengine即可解决。
Microsoft Windows [Version 10.0.19043.1889]
(c) Microsoft Corporation. All rights reserved.
C:\Users\XX>pip install pyqtwebengine
Collecting pyqtwebengine
测试一下效果⬇⬇⬇