0
votes

System and software versions:

  • OSX 10.7.4
  • matplotlib 1.1.1 for Python 2.7 and OSX 10.6, installed via .mpkg.
  • Python 2.7.3, installed via .mpkg.

    import matplotlib.pylabTraceback (most recent call last): File "", line 1, in File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/pylab.py", line 265, in from matplotlib.pyplot import * File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/pyplot.py", line 97, in new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/backends/init.py", line 25, in pylab_setup globals(),locals(),[backend_name]) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/backends/backend_macosx.py", line 21, in from matplotlib.backends import _macosx ImportError: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/backends/_macosx.so, 2): Library not loaded: /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText Referenced from: /Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7.egg/matplotlib/backends/_macosx.so Reason: image not found

4

4 Answers

0
votes

Do you have numpy version 1.4 or later installed? Other prereqs can be found http://matplotlib.org/users/installing.html.

I have gotten ambiguous messages like that when I've been missing a dependency.

0
votes

I had some trouble installing the MatplotLib package myself. See my answer here how I solved it:

How to check whether I have IPython installed on my machine and what sequence to install these libraries?

0
votes

also see:

http://www.zqna.net/qna/knuzvt-i-am-getting-this-error-on-using-matplotlib.html

My solution:

I have OS X 10.7.5, running python 2.7.1, numpy-1.8.0.dev_4600b2f_20130131-py2.7-macosx-10.8-intel.egg, scipy-0.12.0.dev_b69fe18_20130131-py2.7-macosx-10.8-intel.egg

Previously I got the error you have listed above with matplotlib 1.3 not being able to find the CoreText.framework, but when i reverted to matplotlib 1.2 the error went away and i was able to run it just fine - I just edited the easy_install.pth file (not sure if this is the right way to manage the problem, but then I didn't need to make a symlink because the old 1.2 version worked just fine)

The easy install was a reinstall from the fonnesbeck scipy superpack on Feb 8, 2013, I was trying to get everything new since last fall.

0
votes

This is what worked for me:

brew install pkg-config
brew link pkg-config
brew install pygtk
brew install freetype
brew install libpng

sudo ln -s /usr/local/Cellar/freetype/*/lib/pkgconfig/freetype2.pc /usr/local/lib/pkgconfig/freetype2.pc

git clone git@github.com:matplotlib/matplotlib.git
cd matplotlib
python setup.py build
python setup.py install

References:

http://blog.caoyuan.me/2012/08/matplotlib-error-mac-os-x/ http://matplotlib.org/faq/installing_faq.html#install-from-git http://www.tapir.caltech.edu/~dtsang/python.html