How to update Numpy on Mac OS X Snow Leopard?

二次信任 提交于 2019-12-03 15:57:49

问题


How can I update Numpy into the newest one? Should I download .dmg file from here:

http://sourceforge.net/projects/numpy/files/

Is this .dmg only for 10.5? I have installed numpy using these instructions:

http://www.scipy.org/Installing_SciPy/Mac_OS_X

My current Numpy is 1.2.1. I'm running on Mac OS X 10.6.1 Snow Leopard. Thanks!


回答1:


sudo easy_install -U numpy

Installing via setuptools will get the new numpy on the sys.path for non-system utilties (I've been told that some Apple utilities rely on the system-numpy). In general, setuptools will "do the right" thing on OS X.




回答2:


Use pip install -U numpy instead, as easy_install is deprecated in favor of pip




回答3:


as suggested elsewhere, macports works fine on multiple architecture and versions of MacOsX + allows updates and more:

$ port search numpy
py-numpy @1.3.0 (python)
    The core utilities for the scientific library scipy for Python

py25-numpy @1.3.0 (python)
    The core utilities for the scientific library scipy for Python

py25-symeig @1.4 (python, science)
    Symeig - Symmetrical eigenvalue routines for NumPy.

py26-numpy @1.3.0 (python)
    The core utilities for the scientific library scipy for Python

py26-scikits-audiolab @0.10.2 (python, science, audio)
    Audiolab is a python toolbox to read/write audio files from numpy arrays

Found 5 ports.
$

in your case, simply issue :

$ sudo port install py26-numpy

alternatively, if you want / need to compile yourself, the instructions in HJBlog are very useful. I tested and could easily compile the 64-bit version of matplotlib.




回答4:


For some reason, easy_install -U numpy didn't work.

print numpy.__version__

would always give 1.2.1

So, I first removed numpy 1.2.1 by finding it and deleting the entire folder:

import numpy
print numpy.__file__

I downloaded the GNU Fortran Compiler from:

http://r.research.att.com/gfortran-4.2.3.dmg

I used easy_install to install numpy.

In retrospect, easy_install -U numpy might have worked if I had the Fortran compiler installed.



来源:https://stackoverflow.com/questions/1520379/how-to-update-numpy-on-mac-os-x-snow-leopard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!