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

发布于 2024-10-07 01:37:01 字数 1504 浏览 2 评论 0原文

在 OS X 上的 python 2.7 上使用新版本的 Scipy/numpy/matplotlib。我正在尝试导入 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

With a fresh build of Scipy/numpy/matplotlib on python 2.7 on OS X. I am trying to import pylab but it doesn't seem to be working. Why is this?

The error I'm getting is:

> 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独留℉清风醉 2024-10-14 01:37:01

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

The latest version of Python that supports those packages is 2.6.x. I am running them on 2.6.6. You will need to additionally install Python 2.6.x on your machine to use these packages. You can still keep your Python 2.7 and associated programs and run either.

胡渣熟男 2024-10-14 01:37:01

我也有同样的问题。清除我的 DYLD_LIBRARY_PATH 变量解决了这个问题。执行:

$ unset DYLD_LIBRARY_PATH

该变量控制动态链接器搜索哪些目录来查找给定的库。默认情况下它是空的,所以清除它应该没有什么坏处,除非你有一些特殊的设置。检查 man dyld 以供参考。

I had the same problem. Clearing my DYLD_LIBRARY_PATH variable solved the issue. Do:

$ unset DYLD_LIBRARY_PATH

The variable controls which directories the dynamic linker searches to find a given library. By default it is empty so there should be no harm in clearing it, unless you have some special setup. Check man dyld for reference.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文