sip模块实现API v11.0到v11.2,但PyQt5.QtCore模块需要API v11.3

时间:2016-10-14 23:35:15

标签: python python-2.7 pyqt4 qtcore

我遇到此错误的问题。为了记录,我使用PyQt4。谢谢你的帮助!

 (C:\Users\ewasn\Anaconda2) C:\Users\ewasn\Desktop\DataShift>python data_inconsistency_api.py
Traceback (most recent call last):
  File "data_inconsistency_api.py", line 9, in <module>
    from multivariate_outliers import MultivariateOutliers
  File "C:\Users\ewasn\Desktop\DataShift\multivariate_outliers.py", line 8, in <module>
    import matplotlib.pyplot as plt
  File "C:\Users\ewasn\Anaconda2\lib\site-packages\matplotlib\pyplot.py", line 114, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "C:\Users\ewasn\Anaconda2\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "C:\Users\ewasn\Anaconda2\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 16, in <module>
    from .backend_qt5 import QtCore
  File "C:\Users\ewasn\Anaconda2\lib\site-packages\matplotlib\backends\backend_qt5.py", line 27, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "C:\Users\ewasn\Anaconda2\lib\site-packages\matplotlib\backends\qt_editor\figureoptions.py", line 17, in <module>
    import matplotlib.backends.qt_editor.formlayout as formlayout
  File "C:\Users\ewasn\Anaconda2\lib\site-packages\matplotlib\backends\qt_editor\formlayout.py", line 58, in <module>
    from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
  File "C:\Users\ewasn\Anaconda2\lib\site-packages\matplotlib\backends\qt_compat.py", line 127, in <module>
    from PyQt5 import QtCore, QtGui, QtWidgets
RuntimeError: the sip module implements API v11.0 to v11.2 but the PyQt5.QtCore module requires API v11.3

2 个答案:

答案 0 :(得分:0)

我通过使用sip卸载并重新安装pip来解决了这个问题。

pip uninstall sip
pip install sip

刚刚进行升级可能也有效,但我在此期间收到错误,因为该文件正在使用中。

在Anaconda中执行等效操作可能会解决问题。

答案 1 :(得分:0)

我在使用pycharm和pyqt4时遇到了同样的错误...对我来说就是解决方案:

python版本(在我的情况下为python 3.4) pyqt4版本必须匹配 ... 所以我安装了 python-3.4.4.msi ,然后安装了 PyQt4-4.11.4-gpl-Py3.4-Qt4.8.-x32.exe

现在可以使用