9

I just installed numpy and matplotlib on my OS X 10.6.6. I have Python 2.7 from Python.org. When I do an import matplotlib.pyplot, I get the following error:

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

Is there something I missed? How do I fix this?

Update 1 (March 25, 2011):
matplotlib's interactive plotting system uses Tcl/Tk/Tkinter to provide a GUI. I installed the 64-bit Python, but I missed the following caveats in the Python.org download pages link1, link2: http://www.python.org/download/releases/2.7.1/
http://www.python.org/download/mac/tcltk/
Therefore, I deleted the 64-bit version and installed the 32-bit version. I would suggest to keep this question open just in case a 64-bit Tcl/Tk/Tkinter comes out for Python 2.7.

Community
  • 1
  • 1
Kit
  • 30,365
  • 39
  • 105
  • 149
  • How did you install matplotlib? I don't think there's a binary installer for 64-bit OSX with python2.7 yet. It sounds like you have the 32-bit version installed on a 64-bit platform... – Joe Kington Mar 24 '11 at 16:01
  • @Joe: Yes, that's right. I just replaced the 64-bit version with the 32-bit version. Question has been updated accordingly. – Kit Mar 24 '11 at 23:36
  • 1
    Kit, please could you answer your own question, and then accept the answer? Thank you; this has been useful to me. – DanBeale Nov 09 '12 at 22:32

4 Answers4

2

If you want an easy, out of the box solution: The Enthought Python Distribution 7.0 (64-bit academic version) worked great for me on Mac OS X Leopard, including Python 2.7, numpy, and matplotlib: https://www.enthought.com/products/epd.php

jbl
  • 21
  • 2
  • Thank you so much!! I have wasted so much time trying to get stuff like this to work, I'd seen this enthought thing before but didn't realise it was free with a university email address – Anake Oct 27 '11 at 13:17
1

According to this mailing list message, the current matplotlib version from the installer is itself not compatible with the 64-bit version of Python from python.org, so you need the 32-bit version.

On the other hand, the ScipySuperpack installs a development version of matplotlib that works with 64 bit Python.

christianbrodbeck
  • 2,113
  • 2
  • 19
  • 24
0

I think the matplotlib package is not in your sys.path at all.Delete your matplotlib completely,and reinstall it again.

YOng
  • 65
  • 1
  • 7
0

With Python 2.7.2, you can use ActiveTcl, and use IDLE ... See this note: http://www.python.org/download/mac/tcltk/

zhanxw
  • 3,159
  • 3
  • 34
  • 32