5

I am new to python and just trying to set everything up. I've tried reinstalling but still keep getting an error when I try "import matplotlib.pyplot as plt", anyone know what this means?

 Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    import matplotlib.pyplot as plt
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py", line 23, in <module>
from matplotlib.figure import Figure, figaspect
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/figure.py", line 16, in <module>
import artist
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/artist.py", line 6, in <module>
from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/transforms.py", line 34, in <module>
from matplotlib._path import affine_transform
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_path.so, 2): no suitable image found.  Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_path.so: no matching architecture in universal wrapper

Thanks!

8
  • How did you install matplotlib and python2.7 Commented Jul 6, 2011 at 10:16
  • Thanks for the reply, I downloaded a .dmg from python.org (I'm using OSX) and then for maplotlib I first tried to easy_install the .egg which I had downloaded from their site, then I tried a different .egg and then I tried a .dmg (although I realised later the .dmg was for 32 bit, I have 64). So finally I uninstalled everything including python and started again except this time I used pip install matplotlib, which failed because I don't have xcode installed (no gcc) so now I am waiting for that to download. Commented Jul 6, 2011 at 10:31
  • which easy_install? and yes you need Xcode for _path.so Commented Jul 6, 2011 at 10:50
  • setuptools-0.6c11-py2.7.egg right from their site! Commented Jul 6, 2011 at 11:33
  • Ah I meant the path to easy_install - as that could point to Apple's python - and looking at matplotlib.sourceforge.net/faq/… to see which egg to use Commented Jul 6, 2011 at 11:37

1 Answer 1

1

I've run into a similar problem when installing python and matplotlib on multiple Mac OSs. What I ended up doing was reinstalling with Python2.6 and also getting compatible packages. It took a little while to figure out which combination works with which architecture, but eventually I got everything to run.

The matplotlib website even mentions these issuse:

"The build situation on OSX is complicated by the various places one can get the png and freetype requirements from (darwinports, fink, /usr/X11R6) and the different architectures (x86, ppc, universal) and the different OSX version (10.4 and 10.5)."

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

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.