Scipy / Pylab错误..预期在:动态查找?

时间:2010-12-10 19:38:49

标签: python numpy scipy matplotlib

在OS X上的python 2.7上使用Scipy / numpy / matplotlib的全新版本。我正在尝试import pylab但它似乎不起作用。这是为什么?

我得到的错误是:

> Traceback (most recent call last):  
> File "<stdin>", line 1, in <module>  
> File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pylab.py",
> line 1, in <module>
>     from matplotlib.pylab import *   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pylab.py",

> line 216, in <module>
>     from matplotlib import mpl  # pulls in most modules   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl.py",
> line 2, in <module>

>     from matplotlib import axis   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axis.py", line 10, in <module>

>     import matplotlib.font_manager as font_manager   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/font_manager.py", line 52, in <module>

>     from matplotlib import ft2font ImportError:
> dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/ft2font.so,

> 2): Symbol not found: _FT_Attach_File 

> Referenced from:
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/ft2font.so
> Expected in: dynamic lookup

3 个答案:

答案 0 :(得分:1)

支持这些软件包的最新版本的Python是2.6.x.我在2.6.6上运行它们。您需要在计算机上另外安装Python 2.6.x才能使用这些软件包。您仍然可以保留Python 2.7及相关程序并运行。

答案 1 :(得分:0)

加载freetype库失败了。看到: same problem此外,您是否按照这些Instructions进行了操作?

答案 2 :(得分:0)

我遇到了同样的问题。清除我的DYLD_LIBRARY_PATH变量解决了这个问题。做:

$ unset DYLD_LIBRARY_PATH

该变量控制动态链接器搜索哪些目录以查找给定库。默认情况下它是空的,因此除非你有一些特殊的设置,否则清除它应该没有坏处。请查看man dyld以获取参考。