【发布时间】:2010-12-18 20:03:22
【问题描述】:
我已经使用 python 2.6 在 Snow Leopard 上安装了 numpy/scipy/matplotlib。导入 pylab 似乎不起作用。在调用“import pylab”时,我得到以下信息:
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/pylab.py", line 216, in <module>
from matplotlib import mpl # pulls in most modules
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/mpl.py", line 2, in <module>
from matplotlib import axis
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py", line 10, in <module>
import matplotlib.font_manager as font_manager
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py", line 1339, in <module>
_rebuild()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py", line 1326, in _rebuild
fontManager = FontManager()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py", line 1004, in __init__
self.ttffiles = findSystemFonts(paths) + findSystemFonts()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py", line 343, in findSystemFonts
for f in get_fontconfig_fonts(fontext):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py", line 301, in get_fontconfig_fonts
output = pipe.communicate()[0]
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 683, in communicate
stdout = self.stdout.read()
什么给了? pylab 期待我没有的东西吗?它似乎无法阅读某些内容,但我真的不明白那是什么..
【问题讨论】:
-
嗯?那里没有实际错误。您是否粘贴了整个回溯?
-
这就是整个追溯。它挂起,直到我用键盘打断它。也许我会让它坐一会儿,看看有什么事情发生。这个模块应该需要很长时间才能导入吗?
-
你安装了freetype 1.4吗? matplotlib 需要它。
-
四年后同样的问题,这让我怀疑这是否真的是一个应该使用的库......
标签: python macos matplotlib