miki725 miki725 - 11 months ago 70
Python Question

Installing SciPy on Mac OS Lion in Virtualenv

I am trying to install scipy in my vertualenv on mac.

Python using in virtualenv:

(Django)miki725mac:Django miki725$ python
Python 2.7.2 (default, Aug 3 2011, 00:58:00)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

I tries installing scipy by doing this which fails:

$ svn co http://svn.scipy.org/svn/scipy/trunk scipy
$ python setup.py build
$ python setup.py install

Then I tried:

$ pip install scipy

Also as per the suggestion I tried:

$ pip install -e git://github.com/scipy/scipy@effa6f68f8ada57b7986#egg=scipy-dev


Here are the complete logs for all the insallation steps: (they were too long for stackoverflow)

python setup.py build


python setup.py install


pip install scipy

http://www.diglo.com/download/9e808fe5b57b6b01a8265d4b01958da703ea (pastebin: http://paste.pocoo.org/show/454004/ )

pip install -e git://github.com/scipy/scipy@effa6f68f8ada57b7986#egg=scipy-dev


Please help. I am new at all this. Thank you in advance.

Answer Source

Up until August 2011 Scipy was broken on Mac OS X Lion. Fixed in this commit: https://github.com/scipy/scipy/commit/effa6f68f8ada57b79864852b609ff06d2527306

It looks like this change has not yet been merged to SVN trunk. Try github instead:

pip install -e git://github.com/scipy/scipy@effa6f68f8ada57b7986#egg=scipy-dev

That's worked for me on two installs of Lion. However if it doesn't I've heard using GCC-4.0 (instead of the current default: GCC-4.2) also solves the issue (haven't verified it though):

  1. Install macports
  2. sudo port install gcc40
  3. Create a symlink from gcc-4.0 to gcc
  4. Recommended: after scipy is installed, change the symlink to point back to the xcode version of gcc-4.2

Steps 1 & 2 are only needed if you don't already have gcc-4.0.