Scipy/Pylab 错误..预期在:动态查找?
在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
支持这些包的最新 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.
我也有同样的问题。清除我的 DYLD_LIBRARY_PATH 变量解决了这个问题。执行:
该变量控制动态链接器搜索哪些目录来查找给定的库。默认情况下它是空的,所以清除它应该没有什么坏处,除非你有一些特殊的设置。检查
man dyld
以供参考。I had the same problem. Clearing my DYLD_LIBRARY_PATH variable solved the issue. Do:
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.