gpt4 book ai didi

python - 导入 matplotlib 不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 10:22:59 28 4
gpt4 key购买 nike

在我的终端窗口中,我打开 ipython 环境,然后输入 import matplotlib.pyplot as plt。我从中得到的错误信息是:

ImportError                               Traceback (most recent call last)
<ipython-input-1-eff513f636fd> in <module>()
----> 1 import matplotlib.pyplot as plt

/Users/arazipinhas/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
25
26 import matplotlib
---> 27 import matplotlib.colorbar
28 from matplotlib import style
29 from matplotlib import _pylab_helpers, interactive

/Users/arazipinhas/anaconda/lib/python2.7/site-packages/matplotlib/colorbar.py in <module>()
32 import matplotlib.artist as martist
33 import matplotlib.cbook as cbook
---> 34 import matplotlib.collections as collections
35 import matplotlib.colors as colors
36 import matplotlib.contour as contour

/Users/arazipinhas/anaconda/lib/python2.7/site-packages/matplotlib/collections.py in <module>()
25 import matplotlib.artist as artist
26 from matplotlib.artist import allow_rasterization
---> 27 import matplotlib.backend_bases as backend_bases
28 import matplotlib.path as mpath
29 from matplotlib import _path

/Users/arazipinhas/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.py in <module>()
54
55 import matplotlib.tight_bbox as tight_bbox
---> 56 import matplotlib.textpath as textpath
57 from matplotlib.path import Path
58 from matplotlib.cbook import mplDeprecation

/Users/arazipinhas/anaconda/lib/python2.7/site-packages/matplotlib/textpath.py in <module>()
20 from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING
21 from matplotlib.ft2font import LOAD_TARGET_LIGHT
---> 22 from matplotlib.mathtext import MathTextParser
23 import matplotlib.dviread as dviread
24 from matplotlib.font_manager import FontProperties

/Users/arazipinhas/anaconda/lib/python2.7/site-packages/matplotlib/mathtext.py in <module>()
61
62 import matplotlib.colors as mcolors
---> 63 import matplotlib._png as _png
64 ####################
65

ImportError: dlopen(/Users/arazipinhas/anaconda/lib/python2.7/site-packages/matplotlib/_png.so, 2): Library not loaded: @loader_path/../../../libpng15.15.dylib
Referenced from: /Users/arazipinhas/anaconda/lib/python2.7/site-packages/matplotlib/_png.so
Reason: image not found

我非常希望能找到解决此问题的方法。我只想继续我的物理学,所有这些不断的计算挫折非常麻烦和烦人。因此,我应该感谢任何可能愿意提供帮助的人的快速回应。

最佳答案

Continuum 最近更新了 libpng,这导致了这个破损。很抱歉给您带来不便。

修复此错误的方法是在终端中运行

conda update qt
conda update matplotlib

关于python - 导入 matplotlib 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31183848/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com