我最近切换到了 ipython 的 EPD 版本(我有 64 位学生版),现在我在使用 pylab 时遇到了问题。当我输入“import pylab”时,它给了我以下错误
ImportError Traceback (most recent call last)
<ipython-input-1-0c66bb86b884> in <module>()
----> 1 import pylab
/Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7-macosx-10.7-intel.egg/pylab.py in <module>()
----> 1 from matplotlib.pylab import *
2 import matplotlib.pylab
3 __doc__ = matplotlib.pylab.__doc__
/Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7-macosx-10.7-intel.egg/matplotlib/pylab.py in <module>()
219 silent_list, iterable, dedent
220
--> 221 from matplotlib import mpl # pulls in most modules
222
223 from matplotlib.dates import date2num, num2date,\
/Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7-macosx-10.7-intel.egg/matplotlib/mpl.py in <module>()
1 from matplotlib import artist
----> 2 from matplotlib import axis
3 from matplotlib import axes
4 from matplotlib import cbook
5 from matplotlib import collections
/Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7-macosx-10.7-intel.egg/matplotlib/axis.py in <module>()
8 from matplotlib.artist import allow_rasterization
9 import matplotlib.cbook as cbook
---> 10 import matplotlib.font_manager as font_manager
11 import matplotlib.lines as mlines
12 import matplotlib.patches as mpatches
/Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7-macosx-10.7-intel.egg/matplotlib/font_manager.py in <module>()
50 import matplotlib
51 from matplotlib import afm
---> 52 from matplotlib import ft2font
53 from matplotlib import rcParams, get_configdir
54 from matplotlib.cbook import is_string_like
ImportError: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7-macosx-10.7-intel.egg/matplotlib/ft2font.so, 2): Symbol not found: _FT_Attach_File
Referenced from: /Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7-macosx-10.7-intel.egg/matplotlib/ft2font.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7-macosx-10.7-intel.egg/matplotlib/ft2font.so
我需要 pylab/matplotlib 才能生存,所以这很糟糕。有趣的是,当我双击 /Applications/Enthought/ 文件夹中的 PyLab (64-bit).app 时,它会打开一个终端并且 pylab 运行良好,但当我从命令行调用它时它就不起作用,或者当我使用笔记本时。如果我可以让 python 使用我从 EPD 获得的 pylab 版本,那么一切都会好起来的,但默认情况下它会从 /Library/Python/2.7/site-packages/matplotlib-1.1.0-py2.7 导入东西-macosx-10.7-intel.egg/matplotlib/ ft2font.so 出了点问题。