Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Numpy on Mac OS X Lion 10.7

I need to install Numpy on my Mac OS X Lion 10.7. I googled a little bit, it seems like there are a lot of stuff needs to be installed. And some says I need install Xcode before I install Numpy. But the official website of Numpy doesn't give much information about installing Numpy on Mac. I really don't want to install Xcode as it would cost a lot space.

So anyone knows how to install Numpy? What's the prerequisites?

Thanks,

like image 735
Jensen Avatar asked Nov 28 '22 10:11

Jensen


2 Answers

For anyone that hits this from google, here is where I figured out how to build numpy on Mac OS.

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

On lion, it amounts to setting some environment variables (after Xcode is installed):

export CC=gcc-4.2
export CXX=g++-4.2
export FFLAGS=-ff2c

Then pip install numpy works just fine.

like image 33
dlamotte Avatar answered Dec 05 '22 22:12

dlamotte


Lion comes with numpy installed. It should already be there:

$ python -c 'import numpy, numpy.version; print numpy, numpy.version.version'
<module 'numpy' from '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.py'> 1.5.1
like image 102
Ingmar Hupp Avatar answered Dec 05 '22 21:12

Ingmar Hupp