问题描述
在安装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:ignore
RuntimeError: 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.QtCore
Traceback (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,但这没有帮助。谁能告诉我发生了什么事以及如何解决这个问题。
解决方法
我只是在这里猜测,但我认为该错误是指PyQt5-sip,因为最新版本为12.8.0
https://pypi.org/project/PyQt5-sip/
,(此处为pip install pyqt5
来安装它(看来已经做到了)。
这样做,您基本上破坏了Anaconda,现在,您必须删除并重新安装它,对不起。