Setup failure on Max OS X Lion

I just tried to set up numpy on a new laptop with Mac OS X Lion (10.7) and am running into some problems. The laptop came with python 2.7 installed, but when I downloaded the dmg for numpy from the sourceforge side, it refused to install it saying that it couldn't find python 2.7. Odd, but maybe it was installed in some place numpy didn't expect. So I went to python.org and got the official 2.7 installer dmg and stuck that in. Seemed okay. Then I installed numpy using the dmg. Seemed okay. Now, though, when I start python at the terminal (or through Wing IDE) and import numpy, I get Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/__init__.py", line 78, in <module> from numpy import show_config as show_numpy_config 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 numpy.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: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: no matching architecture in universal wrapper I'm not sure whether this is a problem with where the python 2.7 install is located, or whether it's something bespoke about the new Mac OS. I'm pretty sure I followed a similar route on an older laptop (which was OS X 10.6 and has python 2.6 installed by default) and it worked fine; but it was a while ago and I don't really remember. Any suggestions?

Sorted - I downloaded the wrong numpy dmg - I pulled in the mac os x 10.3-labelled dmg instead of the 10.6-labelled dmg, which was further down the list on sourceforge. :) On Jul 22, 2011, at 7:52 AM, Mark Higgins wrote:
I just tried to set up numpy on a new laptop with Mac OS X Lion (10.7) and am running into some problems.
The laptop came with python 2.7 installed, but when I downloaded the dmg for numpy from the sourceforge side, it refused to install it saying that it couldn't find python 2.7. Odd, but maybe it was installed in some place numpy didn't expect.
So I went to python.org and got the official 2.7 installer dmg and stuck that in. Seemed okay.
Then I installed numpy using the dmg. Seemed okay.
Now, though, when I start python at the terminal (or through Wing IDE) and import numpy, I get
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/__init__.py", line 78, in <module> from numpy import show_config as show_numpy_config 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 numpy.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: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: no matching architecture in universal wrapper
I'm not sure whether this is a problem with where the python 2.7 install is located, or whether it's something bespoke about the new Mac OS. I'm pretty sure I followed a similar route on an older laptop (which was OS X 10.6 and has python 2.6 installed by default) and it worked fine; but it was a while ago and I don't really remember.
Any suggestions?

On Fri, Jul 22, 2011 at 4:52 AM, Mark Higgins <miggins@gmail.com> wrote:
I just tried to set up numpy on a new laptop with Mac OS X Lion (10.7) and am running into some problems.
Any suggestions?
On a freshly upgraded-to Lion installation: $ which python /usr/bin/python $ python Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import numpy numpy.__version__ '1.5.1' numpy.__file__ '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.py'
If you need the latest release, instead of the Apple supplied version 1.5.1: $ sudo easy_install -U numpy --SNIPPED-- $ python Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import numpy numpy.__version__ '1.6.1' numpy.__file__ '/Library/Python/2.7/site-packages/numpy-1.6.1-py2.7-macosx-10.7-intel.egg/numpy/__init__.pyc' numpy.int_ <type 'numpy.int64'>
Consider using 'pip' instead of 'easy_install', for adding and searching PyPI packages: $ sudo easy_install pip $ sudo pip search numpy If you need a newer python later on, consider using Homebrew (after installing Xcode 4.1): http://mxcl.github.com/homebrew/ http://github.com/mxcl/homebrew/wiki/Installation # Note that Homebrew does *not* need to use 'sudo', and after installing python # both 'pip' and 'easy_install' will be the Homebrew installed versions... $ ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" $ brew update $ brew install python $ hash -r $ python Python 2.7.2 (default, Jul 22 2011, 10:32:09) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. $ pip install --upgrade numpy etc... -Chad
participants (2)
-
Chad Netzer
-
Mark Higgins