在安装 PyQt5 时,我无法在 Windows 上启动 Spyder。当我尝试通过 conda 提示启动时,出现以下错误,File "C:\Users\sarshetty\Anaconda3\lib\site-packages\qtpy\__init__.py", line 132, in <module> from PyQt5.QtCore import PYQT_VERSION_STR as PYQT_VERSION # analysis:ignoreRuntimeError: the sip module implements API v12.0 to v12.7 but the PyQt5.QtCore module requires API v12.8我在 python 终端中看到我的 sip 和 PyQt 的以下内容。>>> import sip>>> sip.SIP_VERSION_STR'4.19.8'>>> import PyQt5>>> import PyQt5.Qt>>> import PyQt5.QtCoreTraceback (most recent call last): File "<stdin>", line 1, in <module>RuntimeError: the sip module implements API v12.0 to v12.7 but the PyQt5.QtCore module requires API v12.8我尝试升级我的 sip,但这没有帮助。任何人都可以告诉我发生了什么以及我如何解决这个问题。
3 回答

暮色呼如
TA贡献1853条经验 获得超9个赞
这为我解决了这个问题
使用 pip 卸载已安装的 PyQt5 库
pip3 uninstall pyqt5
使用 conda 安装 PyQt5
conda install -c anaconda pyqt

Smart猫小萌
TA贡献1911条经验 获得超7个赞
卸载 pyqt5(pip uninstall pyqt5) 然后重新安装 5.11.3 版本(pip install pyqt5==5.11.3) 安装新版本后它会显示一条错误信息,但它仍然可以工作。这对我和我的大学都有效。

繁星点点滴滴
TA贡献1803条经验 获得超3个赞
(这里是 Spyder 维护者)Anaconda 带有自己的 PyQt5 版本,所以你不需要通过运行来安装它pip install pyqt5
(你似乎这样做了)。
通过这样做,你基本上破坏了 Anaconda,现在你必须删除并重新安装它,抱歉。
添加回答
举报
0/150
提交
取消