当我尝试导入pyplot
时:
import matplotlib.pyplot as plt
我收到此错误:
File "/home/riless/script.py", line 7, in <module>
import matplotlib.pyplot as plt
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 109, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5agg.py", line 18, in <module>
from .backend_qt5 import QtCore
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 31, in <module>
from .qt_compat import QtCore, QtGui, QtWidgets, _getSaveFileName, __version__
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/qt_compat.py", line 111, in <module>
from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: cannot import name QtGui
我不知道它是否有帮助,但是:
PyQt gpl 5.4.1
时,我已将选项--qmake
设置为包含Qt5的qmake二进制文件的路径。pip install matplotlib
修改
QtCore
似乎导入得很好但是存在问题avec QtGui