0

我正在使用 mac 山狮(10.8.1)和 python(2.7.3)。我想使用 python matplotlib、numpy 模块来计算图形。但是山狮没有matplotlib,numpy ver。我已经用 matplotlib(1.1.1)、numpy(1.7.0b1) 进行了测试。他们已经安装好了。但它不像下面那样工作。我只需要一张图表。山狮用户可以用python画图吗?

>>>import numpy

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import numpy
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module>
    import add_newdocs
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/add_newdocs.py", line 9, in <module>
    from bumpy.lib import add_newdoc
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/__init__.py", line 4, in <module>
    from type_check import *
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/type_check.py", line 8, in <module>
    import numpy.core.numeric as _nx
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py", line 5, in <module>
    import multiarray
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): no suitable image found. Did find:
        /Libraray/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: no matching architecture in universal wrapper
4

1 回答 1

1

没有特定的“针对 Mountain Lion”的 numpy 或 matplotlib。唯一的兼容性考虑是 python 版本,在你的情况下它很好。我的猜测是你只需要强制它只构建 64 位:

ARCHFLAGS="-arch x86_64" pip install numpy
于 2012-08-29T05:56:10.413 回答