无法导入matplotlib(anaconda)

时间:2017-06-12 01:34:13

标签: python matplotlib anaconda

我在Ubuntu 14.04上安装了anaconda 4.4.0。我在导入matplotlib.pyplot时遇到了一些麻烦。我查看了很多网站,但没有答案可以解决我的问题。

以下是我收到的错误消息:

>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/matplotlib/pyplot.py", line 115, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py", line 16, in <module>
    from .backend_qt5 import QtCore
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/matplotlib/backends/backend_qt5.py", line 26, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 20, in <module>
    import matplotlib.backends.qt_editor.formlayout as formlayout
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/matplotlib/backends/qt_editor/formlayout.py", line 56, in <module>
    from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/matplotlib/backends/qt_compat.py", line 128, in <module>
    from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

有谁知道如何解决这个问题?

谢谢

修改

错误消息已更改:

>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/matplotlib/__init__.py", line 105, in <module>
    import six
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/six.py", line 25, in <module>
    import functools
  File "/home/lucasgruwez/anaconda3/lib/python3.6/functools.py", line 21, in <module>
    from collections import namedtuple
  File "/home/lucasgruwez/anaconda3/lib/python3.6/site-packages/matplotlib/collections.py", line 15, in <module>
    from six.moves import zip
ModuleNotFoundError: No module named 'six.moves'; 'six' is not a package

0 个答案:

没有答案