V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
zyceeo
V2EX  ›  Python

Anaconda 中 import pylab as pl 错误

  •  
  •   zyceeo · 2015-05-30 23:17:06 +08:00 · 5266 次点击
    这是一个创建于 3499 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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

    请问如何结局??谢谢帮助哦!非常感谢!
    6 条回复    2015-06-02 14:04:15 +08:00
    LeoQ
        1
    LeoQ  
       2015-05-30 23:37:02 +08:00 via Android
    http://www.tuicool.com/articles/36ZbI3b 这是我看到的一个 anaconda 安装使用说明,希望可以帮到你,另外你检查了自己的安装步骤和使用步骤么
    sone
        2
    sone  
       2015-05-31 00:17:48 +08:00
    缺少libpng15. 尝试:
    export DYLD_LIBRARY_PATH=/Users/xxx/anaconda/lib:$DYLD_LIBRARY_PATH
    不行就去下载个libpng15版本。记得加到librarypath就行了。
    zyceeo
        3
    zyceeo  
    OP
       2015-05-31 15:18:31 +08:00
    @LeoQ thanks!这个是anaconda的重新安装!我按照建议重新安装试一次,非常感谢哈!
    zyceeo
        4
    zyceeo  
    OP
       2015-05-31 15:19:36 +08:00
    @sone 非常遗憾的是我是个小白~所以,请问如何将下载到的libpng15加到librarypath呢?
    zerh925
        5
    zerh925  
       2015-06-01 03:32:17 +08:00
    interpreter是选的anaconda的那个python吗?
    recall704
        6
    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

    仅供借鉴.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1174 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 18:15 · PVG 02:15 · LAX 10:15 · JFK 13:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.