原因: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
成功!