本文介绍了带有来自Python.org的64位Python的OS X上的Matplotlib.pyplot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在OS X 10.6.6上安装了numpymatplotlib.我有来自Python.org的Python 2.7.当我执行import matplotlib.pyplot时,出现以下错误:

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?

更新1(2011年3月25日):
matplotlib的交互式绘图系统使用Tcl/Tk/Tkinter提供GUI.我安装了64位Python,但在Python.org下载页面中错过了以下警告: link1 link2 :

因此,我删除了64位版本并安装了32位版本.我建议让这个问题保持开放,以防Python 2.7出现64位Tcl/Tk/Tkinter.

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:

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.

推荐答案

如果您想使用一个简单易用的解决方案:The Enthought Python Distribution 7.0(64位学术版)在Mac OS X Leopard上非常适合我,包括Python 2.7,numpy和matplotlib: https://www.enthought.com/products/epd .php

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

这篇关于带有来自Python.org的64位Python的OS X上的Matplotlib.pyplot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 07:42