The sip module implements API v11.0 to v11.2 but the PyQt5.QtCore module requires API v11.3

那年仲夏 提交于 2019-12-06 07:50:15

问题


I have a problem with this error. For the record, I'm using PyQt4. Thanks for any help!

 (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

回答1:


I solved this issue by uninstalling and reinstalling sip using pip.

pip uninstall sip
pip install sip

Just doing the upgrade might have work as well, but I got an error during it because the file was in use.

Doing the equivalent in Anaconda might solve the issue.




回答2:


I got the same error with pycharm and pyqt4 ... for me was the solution:

The python version (in my case python 3.4) and the pyqt4 version have to match... So I insalled python-3.4.4.msi and after this PyQt4-4.11.4-gpl-Py3.4-Qt4.8.-x32.exe

Now it works



来源:https://stackoverflow.com/questions/40053422/the-sip-module-implements-api-v11-0-to-v11-2-but-the-pyqt5-qtcore-module-require

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!