|
From: Steve B. <sgw...@ya...> - 2011-10-22 16:46:09
|
All, On my iMac at work running 10.6.8, I did a brew-based installation of Python 2.7.2. I used pip to install scipy, numpy and then matplotlib. The last didn't work right so I scoured the internets to find out what to do. The first solution I found suggested doing a git clone of the repository and running python setup.py build then python setup.py install. That worked just great. At home, I tried the same thing on my MBP running 10.6.8. When I got to the compile matplotlib step, the fix from above didn't work. So I started trying other solutions I had found. Many of them "worked", however, when I went to run this simple script: import matplotlib.pylab as plt from scipy.stats import norm I got this error: Traceback (most recent call last): File "plot.py", line 1, in <module> import matplotlib.pylab as plt File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.4-x86_64.egg/matplotlib/pylab.py", line 221, in <module> from matplotlib import mpl # pulls in most modules File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.4-x86_64.egg/matplotlib/mpl.py", line 2, in <module> from matplotlib import axis File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.4-x86_64.egg/matplotlib/axis.py", line 10, in <module> import matplotlib.font_manager as font_manager File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.4-x86_64.egg/matplotlib/font_manager.py", line 1323, in <module> _rebuild() File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.4-x86_64.egg/matplotlib/font_manager.py", line 1273, in _rebuild fontManager = FontManager() File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.4-x86_64.egg/matplotlib/font_manager.py", line 997, in __init__ self.afmlist = createFontList(self.afmfiles, fontext='afm') File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.4-x86_64.egg/matplotlib/font_manager.py", line 565, in createFontList prop = afmFontProperty(fpath, font) File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.4-x86_64.egg/matplotlib/font_manager.py", line 501, in afmFontProperty weight = weight_as_number(font.get_weight().lower()) File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.4-x86_64.egg/matplotlib/afm.py", line 464, in get_weight return self._header['Weight'] KeyError: 'Weight' Googling did not reveal a single occurrence of this error reported anywhere. And so I would move on to the next instructions for compilation including the original make.osx instructions...and while the compilations succeeded, I still got the same error. Finally I decided to try the Enthought completely pre-compiled and packaged installation. Same problem. I'm at a loss. I even completely erased my /usr/local/ directory so that everything would be consistently installed via Homebrew. But no matter what I do, I end up with the same problem. I'm considering that something is wrong with my Snow Leopard installation and perhaps (reluctantly) upgrading to Lion, something I haven't really felt compelled to do. I'm hoping that there is a setting that I neglected. Ideas? Thanks, Steve |