Anaconda 中 import pylab as pl 错误

2015-05-30 23:17:06 +08:00
 zyceeo
OS X中IDE pycharm中import pylab as pl报错如下:
ImportError Traceback (most recent call last)
<ipython-input-7-2cf12a0af6ff> in <module>()
----> 1 import pylab as pl

/Users/eric/anaconda/lib/python3.4/site-packages/pylab.py in <module>()
----> 1 from matplotlib.pylab import *
2 import matplotlib.pylab
3 __doc__ = matplotlib.pylab.__doc__

/Users/eric/anaconda/lib/python3.4/site-packages/matplotlib/pylab.py in <module>()
229 # make mpl.finance module available for backwards compatability, in case folks
230 # using pylab interface depended on not having to import it
--> 231 import matplotlib.finance
232
233 from matplotlib.dates import date2num, num2date,\

/Users/eric/anaconda/lib/python3.4/site-packages/matplotlib/finance.py in <module>()
36 from matplotlib.dates import date2num
37 from matplotlib.cbook import iterable, mkdirs
---> 38 from matplotlib.collections import LineCollection, PolyCollection
39 from matplotlib.colors import colorConverter
40 from matplotlib.lines import Line2D, TICKLEFT, TICKRIGHT

/Users/eric/anaconda/lib/python3.4/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/eric/anaconda/lib/python3.4/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/eric/anaconda/lib/python3.4/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/eric/anaconda/lib/python3.4/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/eric/anaconda/lib/python3.4/site-packages/matplotlib/_png.so, 2): Library not loaded: @loader_path/../../../libpng15.15.dylib
Referenced from: /Users/eric/anaconda/lib/python3.4/site-packages/matplotlib/_png.so
Reason: image not found

请问如何结局??谢谢帮助哦!非常感谢!
5242 次点击
所在节点    Python
6 条回复
LeoQ
2015-05-30 23:37:02 +08:00
http://www.tuicool.com/articles/36ZbI3b 这是我看到的一个 anaconda 安装使用说明,希望可以帮到你,另外你检查了自己的安装步骤和使用步骤么
sone
2015-05-31 00:17:48 +08:00
缺少libpng15. 尝试:
export DYLD_LIBRARY_PATH=/Users/xxx/anaconda/lib:$DYLD_LIBRARY_PATH
不行就去下载个libpng15版本。记得加到librarypath就行了。
zyceeo
2015-05-31 15:18:31 +08:00
@LeoQ thanks!这个是anaconda的重新安装!我按照建议重新安装试一次,非常感谢哈!
zyceeo
2015-05-31 15:19:36 +08:00
@sone 非常遗憾的是我是个小白~所以,请问如何将下载到的libpng15加到librarypath呢?
zerh925
2015-06-01 03:32:17 +08:00
interpreter是选的anaconda的那个python吗?
recall704
2015-06-02 14:04:15 +08:00
我之前也遇到过一个问题
symbol lookup error: /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0: undefined symbol: cairo_ft_font_options_substitute

然后我是这样修复的.
conda update cairo

结果又来一个错误
libpng15.so.15: cannot open shared object file: No such file or directory

我从源码安装了
libpng15

并创建了软链接
sudo ln -s /usr/local/lib/libpng15.so /usr/lib/libpng15.so.15

仅供借鉴.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/195006

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX