I’m new to Mac so please bear with me.
I’m using snow leopard 10.6.4 at the moment.
I want to install numpy and scipy, so I downloaded the python2.6,numpy and scipy dmg files from their official site. However, I’m having problem import numpy:
Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/multiarray.so: no matching architecture in universal wrapper
Can anyone shed some light to this problem?
Sounds as though you might be trying to use a 32-bit library from a 64-bit Python. Looks like there’s an unofficial 64-bit Numpy available for Snow Leopard.
EDIT: The Python 2.6 .dmg available here is indeed 32-bit. (Specifically, it’s a universal binary containing both i386 and ppc versions). The same is true of the regular numpy and scipy .dmg releases available here. (How do I know? See below!) So if you use those releases together you should be fine.
But you’re not fine – so my guess is you’re not using the version of Python from the 2.6 .dmg you downloaded. If you’re running an executable python script, e.g.:
then you could try specifying the Python you’re using explicitly on the command line. Looks like the MacPython .dmg installs to /usr/local/bin/python, so try:
Any joy?
How I determined the architecture the contents of those .dmg files are built for…
Use gunzip and pax to unpack the package contents to a local directory, e.g.:
Use
fileto examine binary files in the package contents