[SciPy-User] Building numpy/scipy for python3 on MacOS Lion

Eddy Barratt eddybarratt1@yahoo.co...
Mon Mar 12 16:46:07 CDT 2012


I can't get Numpy or Scipy to work with Python3 on Mac OSX Lion.

I have used pip successfully to install numpy, scipy and matplotlib, and they work well with Python2.7, but in Python3 typing 'import numpy' brings up 'No module named numpy'. I've tried downloading the source code directly and then running 'python3 setup.py build', but I get various error warnings, some in red that have to do with fortran (e.g. 'Could not locate executable f95'). The error message that appears to fail in the end is 'RuntimeError: Broken toolchain: cannot link a simple C program', and appears to be related to the previous line 'sh: gcc-4.2: command not found'.

The Scipy website (http://www.scipy.org/Installing_SciPy/Mac_OS_X) suggests that there may be issues with the c compiler, but the same problems didn't arise using pip to install for python2.7. I have followed the instructions on the website regarding changing the compiler but this has not made any difference.


I have also tried installing from a virtual environment:


>>> mkvirtualenv -p python3.2 test1
>>> pip install numpy

But this fails with "Command python setup.py egg_info failed with error code 1 in /Users/Eddy/.virtualenvs/test1/build/numpy"
I've considered making python3 default, and then I thought a pip install might work, but I don't know how to do that. Does anyone have any suggestions for how I might proceed? I'm relatively new to Python but it's something I feel I'm likely to become more involved in so I'd like to start using Python3 before I get too established with 2.7. Thanks for your help.

Eddy


More information about the SciPy-User mailing list