Numpy Install Mac Osx Python

I am using Python for the Linear Algebra programming course. For the tools we need, I am trying to install NumPy. I used this website to guide me through the installation process.

I started with links to a SciPy OS X page and ended up with a SourceForge download site .

From there, I chose the Mac OS X installer numpy-1.6.1-py2.7-python.org-macosx10.3.dmg .

When I went to standby and dialed

 >>> import numpy as np 

This is the error I received:

 Traceback (most recent call last): File "<string>", line 1, in <module> 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 also tried it from the terminal and got the same error. I have a virtual environment installed - a virtual env shell. I called the environment in the terminal:

 source my_new_env/bin/activate 

And then I tried to import numpy into the terminal this way, but then I got an error:

 (my_new_env) $ sudo python -c 'import numpy; numpy.test()' Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named numpy 

I'm not sure if I installed NumPy incorrectly or if my virtual environment conflicts with Nose. If anyone has any suggestions let me know!

+7
source share
2 answers

I would skip installing the MacOS package and use the instructions for 'pip install', since you are already familiar with virtualenvs. use the following instructions instead: http://www.scipy.org/install.html#installing-via-pip

it’s easier to work with virtualenv and pip, which will provide a post-install so that your virtualenv will have access to the modules you have installed. this requires more work with the external package you downloaded (or .dmg). not impossible, just more work. NTN.

+1
source

Try the following commands:

brew update , brew doctor

because in my case I didn’t even have to install numpy separately. But I could easily import numpy . In the meantime, you can try downloading the numpy package from this website .

0
source

All Articles