matplotlib远程群集上的自动收报机错误

时间:2015-09-13 05:55:42

标签: python matplotlib

我有一个在我的本地计算机上正常运行的Python代码。但是当我在远程集群上运行相同的代码时,我收到以下错误:

    Traceback (most recent call last):
    from matplotlib import ticker as mtick                  # Import mtick for tick locating and formatting.
  File "/home/nxkr/.local/lib/python2.7/site-packages/matplotlib/ticker.py", line 158, in <module>
    from matplotlib import transforms as mtransforms
  File "/home/nxkr/.local/lib/python2.7/site-packages/matplotlib/transforms.py", line 39, in <module>
    from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

错误来源是来自matplotlib导入代码的为mtick ,但它在我的本地计算机上正常运行。本地和远程群集上的matplotlib版本是1.4.3。为什么会出现此错误以及如何解决?

更新

当我评论该行时,我backend_pdf会产生以下错误:

from matplotlib.backends.backend_pdf import PdfPages    # Import PDF matplotlib backend.
  File "/home/nxkr/.local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 35, in <module>
    from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
  File "/home/nxkr/.local/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 45, in <module>
    import matplotlib.transforms as transforms
  File "/home/nxkr/.local/lib/python2.7/site-packages/matplotlib/transforms.py", line 39, in <module>
    from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: /home/nxkr/.local/lib/python2.7/site-packages/matplotlib/_path.so: undefined symbol: PyUnicodeUCS2_AsEncodedString

评论会导致pyplot抛出此错误:

    import matplotlib.pyplot as plt                         # Import matplotlib for plotting.
  File "/home/nxkr/.local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 27, in <module>
    import matplotlib.colorbar
  File "/home/nxkr/.local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 32, in <module>
    import matplotlib.artist as martist
  File "/home/nxkr/.local/lib/python2.7/site-packages/matplotlib/artist.py", line 12, in <module>
    from .transforms import Bbox, IdentityTransform, TransformedBbox, \
  File "/home/nxkr/.local/lib/python2.7/site-packages/matplotlib/transforms.py", line 39, in <module>
    from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: /home/nxkr/.local/lib/python2.7/site-packages/matplotlib/_path.so: undefined symbol: PyUnicodeUCS2_AsEncodedString

为什么相同版本的matplotlib会在不同的机器上产生问题?

0 个答案:

没有答案