cmucpper
cmucpper
采纳率0%
2016-01-23 12:13 阅读 2.5k

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

100

各位大神好,
我在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 把分全给哥 2016-01-23 12:35

    图片说明

    点赞 1 评论 复制链接分享
  • caozhy 从今以后生命中的每一秒都属于我爱的人 2016-01-23 12:15

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

    点赞 评论 复制链接分享
  • 91program 91program 2016-01-23 12:21

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

    点赞 评论 复制链接分享
  • oyljerry oyljerry 2016-01-23 13:40

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

    点赞 评论 复制链接分享

相关推荐