Install numpy from

(I looked through many answers here, but didn’t answer or didn’t answer my question).

I am using numpy + scipy + matplotlib for Mac OSX 10.8.5. I have numpy 1.6.1 on my machine and using python 2.7.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/ . I have been working with this configuration for several months with Idle or command line.

I just upgraded to matplotlib 1.3.1 from a .dmg file in Sourceforge. Installation worked fine, and I see the correct version in matplotlib.__version__ . However, I cannot use it because it claims that I need numpy 1.7 or higher. So I downloaded the numpy-1.8.0 dmg file from Sourceforge and installed it using the Mac installer. The installer claims to have done it right, but numpy.__version__ is still 1.6.1 !!! I did the installation several times (each time successfully according to the Mac installer) with the same result.

I had no problems updating matplotlib to 1.3.1 and scipy to 0.13 using their .dmg files in Sourceforge. I do not understand why numpy should not be installed the same way. I had to update it the same way as in the past, but I do not remember.

I am running Python from Idle, as well as from the command line and don’t want to switch to another distribution such as Macports, etc. I have been using Python this way for 4 years and don't understand why numpy is not updating. Thanks for any help.

+1
source share
1 answer

Three solutions, one of which is indicated in my comment, but the easiest way is to change your PYTHONPATH . At the command line:

 export PYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/:$PYTHONPATH 

To make the change permanent, put this line in your

 ~/.bashrc 

file.


From my comment:
I'm not sure how dangerous this is, but just move the installation according to your others, you can try

 mv /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/n‌​umpy/ /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/n‌​umpy_old/ cp /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/nump‌​‌​y/ /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/n‌​umpy/ 

Finally, you can try using pip to install numpy. To find out where pip installed, type this in the terminal:

 which pip 

If you want it to be ( /Library/... ), then all you have to do is

 pip install numpy 
+1
source

All Articles