本文介绍了sip 模块实现了 API v11.0 到 v11.2,但 PyQt5.QtCore 模块需要 API v11.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个错误的问题.为了记录,我正在使用 PyQt4.感谢您的帮助!

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

推荐答案

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

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.

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

Doing the equivalent in Anaconda might solve the issue.

这篇关于sip 模块实现了 API v11.0 到 v11.2,但 PyQt5.QtCore 模块需要 API v11.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-19 14:03