from PyQt5.QtWidgets import QWidget, QApplicationImportError: DLL load failed while importing QtWid

原因:PyQt5与PyQt5-tool不兼容 或者说与python版本也不合适,反正很玄学,这里只说我的解决方法,仅供参考。

在虚拟环境中

pip uninstall PyQt5

然后再重新

pip install PyQt5 

虽然Successfully installed PyQt5-5.15.10

但是报错

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pyqt5-plugins 5.15.9.2.3 requires pyqt5==5.15.9, but you have pyqt5 5.15.10 which is incompatible.
pyqt5-tools 5.15.9.3.3 requires pyqt5==5.15.9, but you have pyqt5 5.15.10 which is incompatible.

显然版本不兼容,再次卸载PyQt5 按照报错指示重装制定版本的PyQt5

pip install PyQt5==5.15.9

好,依旧不行

直接说我经过一天半最后最后怎么解决的

重新创建了python=3.7的虚拟环境

然后直接

pip install pyqt5-tools

会报错Microsoft Visual C++ 14.0 is required.

然后pip错误“Microsoft Visual C++ 14.0 is required.”解决办法 - 知乎 (zhihu.com)

整好c++环境

pip install pyqt5-tools

成功! 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值