Import matplotlib.pyplot does not work

I am new to python and just trying to configure everything. I tried to reinstall, but still get an error message when I try to "import matplotlib.pyplot as plt", does 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!

+4
source share
1 answer

I had a similar problem when installing python and matplotlib on multiple Mac OS. What I ended up reinstalling with Python2.6, as well as getting compatible packages. It took a little time to figure out which combination works with which architecture, but in the end I got everything to work.

The matplotlib website even mentions this:

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

+1
source

All Articles