3

I get this error on typing this in python command prompt: import matplotlib.pyplot as plt

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import matplotlib.pyplot as plt
  File "/Library/Python/2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.8-intel.egg/matplotlib/pyplot.py", line 97, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/Library/Python/2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.8-intel.egg/matplotlib/backends/__init__.py", line 25, in pylab_setup
    globals(),locals(),[backend_name])
  File "/Library/Python/2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.8-intel.egg/matplotlib/backends/backend_macosx.py", line 21, in <module>
    from matplotlib.backends import _macosx
ImportError: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.8-intel.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.3.x-py2.7-macosx-10.8-intel.egg/matplotlib/backends/_macosx.so
  Reason: image not found

Can someone suggest me, how i can fix this ? I had installed all the packages with this shell script

https://github.com/fonnesbeck/ScipySuperpack

Is there anything that i am missing ? Any additional configuration ?

5
  • When are you getting this error? Commented Oct 28, 2012 at 16:50
  • @Mr.Squig on typing "import matplotlib.pyplot as plt" in python command prompt Commented Oct 28, 2012 at 16:57
  • I get this error whenever i try to use any functions of matplotlib such as graph etc... Commented Oct 28, 2012 at 16:58
  • Do you get an error when you type import PIL? Commented Oct 28, 2012 at 17:00
  • i dont get any error even if i type import matplotlib Commented Oct 28, 2012 at 17:01

2 Answers 2

2

I am seconding andershqst for OSX 10.7.4:

Go to this directory:

cd /System/Library/Frameworks

Verify that this path exists:

ls /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText

Create this soft link:

sudo ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework Coretext.framework

Then test your fix, as described in this tutorial.

Sign up to request clarification or add additional context in comments.

1 Comment

This worked for me, but the path I had to verify existed was the same I then symlinked, not the one he mentions need to be verified. I.e. it was the suggested path with the .framework suffix: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework.
0

I had the same problem using ScipySuperpack and solved it the following way.

Open terminal and locate the path to CoreText.framework file

sudo find / -name "CoreText.framework"

Create a symbolic link from the CoreText file at the located path, to the path in the ImportError

sudo ln -s path_located path_where_it_is_missing

At this point I got another build error because I run OSX 10.7.5 (10.8 being the one you'll currently get from the ScipySuperpack page) In that case, get the ScipySuperpack from here and answer 'yes' when prompted 'Are you installing from a repository cloned to this machine (if unsure, answer no)? (y/n)'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.