2 cmucpper cmucpper 于 2016.01.23 20:13 提问

python matplotlib报错 mac系统,急!!! 100C

各位大神好,
我在spyder中输入import matplotlib.pyplot as plt

结果就报错了:
Traceback (most recent call last):
File "", line 1, in
File "/Users/kevin/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 685, in runfile
execfile(filename, namespace)
File "/Users/kevin/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 78, in execfile
builtins.execfile(filename, *where)
File "/Users/kevin/Desktop/matplot.py", line 8, in
import matplotlib.pyplot as plt
File "/Users/kevin/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py", line 27, in
import matplotlib.colorbar
File "/Users/kevin/anaconda/lib/python2.7/site-packages/matplotlib/colorbar.py", line 34, in
import matplotlib.collections as collections
File "/Users/kevin/anaconda/lib/python2.7/site-packages/matplotlib/collections.py", line 27, in
import matplotlib.backend_bases as backend_bases
File "/Users/kevin/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 56, in
import matplotlib.textpath as textpath
File "/Users/kevin/anaconda/lib/python2.7/site-packages/matplotlib/textpath.py", line 22, in
from matplotlib.mathtext import MathTextParser
File "/Users/kevin/anaconda/lib/python2.7/site-packages/matplotlib/mathtext.py", line 63, in
import matplotlib._png as _png
ImportError: dlopen(/Users/kevin/anaconda/lib/python2.7/site-packages/matplotlib/_png.so, 2): Library not loaded: @loader_path/../../../libpng15.15.dylib
Referenced from: /Users/kevin/anaconda/lib/python2.7/site-packages/matplotlib/_png.so
Reason: image not found

好像是libpng15.15.dylib没安装?求问这是什么?具体怎么操作?
我用的OSX,anaconda

多谢!!

----------------------------------
日了,直接重新换了个解释器,解决了!

4个回答

enpterexpress
enpterexpress   2016.01.23 20:35

图片说明

cmucpper
cmucpper 那些包我都装了,还是不行,是libpng15.15.dylib的问题好像,以及我这是mac。。。
接近 2 年之前 回复
caozhy
caozhy   Ds   Rxr 2016.01.23 20:15

execfile(filename, namespace)
看样子是少文件或者环境变量没有配置好。

oyljerry
oyljerry   Ds   Rxr 2016.01.23 21:40

你再安装libpbg等库到系统上 有这个依赖

91program
91program   Ds   Rxr 2016.01.23 20:21

libpng 是一个开源的 PNG 解码库
我只在PC和WinCE下使用过,OSX 没有用过
建议你查找一下 libpng 的 OSX 可以库,放到你的系统中试试

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!