Reputation: 117
(I looked at many answers on here but similar questions were not answered or didn't address my question).
I use numpy + scipy + matplotlib on 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've been running with that configuration for several months running from Idle or the command line.
I just upgraded to matplotlib 1.3.1 from the .dmg file at Sourceforge. The install worked fine and I can see the correct version in matplotlib.__version__
. However, I cannot use it because it claims 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 correctly, but numpy.__version__
is still 1.6.1!!! I've done the installation multiple times (each time successfully according to the Mac installer) with the same result.
I had no problem upgrading matplotlib to 1.3.1 and scipy to 0.13 using their respective .dmg files at Sourceforge. I don't see why numpy should not install the same way. I must have upgraded it the same way in the past, but I can't remember.
I run Python from Idle as well as from the command line and don't want to go to some other distribution like Macports, etc. I've been using Python this way for 4 years and don't understand why numpy is not being updated. Thanks for any help.
Upvotes: 1
Views: 1759
Reputation: 46578
Three solutions, one is the one given in my comment, but an easier one might be to change your PYTHONPATH
. On the command line:
export PYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/:$PYTHONPATH
To make the change permanent, put that line in your
~/.bashrc
file.
From my comment:
I'm not sure how dangerous it is, but to just move the installation to be with your others, you could try
mv /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/ /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy_old/
cp /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/ /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/
Finally, you could try using pip
to install numpy. To see where pip
is installed, type this in terminal:
which pip
If it's where you want it to be (/Library/...
), then all you have to do is
pip install numpy
Upvotes: 1