« Building NumPy, SciPy & Matplotlib for Python 2.7 on Snow Leopard django-lastfm 1.0 »
.

Building SciPy on Snow Leopard with Python 2.7

I recently had some struggle to build and install SciPy 0.8.0 on Mac OS X 10.6 Snow Leopard, but actually it’s quite easy.

I used the instructions on scipy.org and the HJBlog as source. Since there are builds of NumPy 1.5.0 for Python 2.7 available, you don’t need to install fftw and umfpack manually.

You only need to install gfortran from this site. Pick the latest build for Snow Leopard (e.g. this one).

Next, install NumPy with the disk image from SourceForge or with pip:

$ pip install numpy

To build and install SciPy, download the latest version from SourceForge and do the following:

$ tar -xf scipy-0.8.0.tar.gz
$ cd scipy-0.8.0
$ export CFLAGS="-arch i386 -arch x86_64"
$ export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64"
$ export FFLAGS="-arch i386 -arch x86_64"
$ export MACOSX_DEPLOYMENT_TARGET=10.6
$ python setup.py build
$ python setup.py install

Everything in one command:

$ CFLAGS="-arch i386 -arch x86_64" LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" FFLAGS="-arch i386 -arch x86_64" MACOSX_DEPLOYMENT_TARGET=10.6 python setup.py build install

I hope this works for you as well as it did for me.

Comment

  1. Todd Small on November 28, 2010 at 03:11:

    Thanks for the straightforward instructions. They worked perfectly for me.

    Todd

  2. Arif Abdullah on December 4, 2010 at 09:09:

    Very useful. Thanks for sharing :)

  3. Connor on January 14, 2011 at 20:32:

    Thanks! This finally got it working.

  4. Milo Lennot on May 6, 2011 at 15:41:

    Thank you very much for simple, concise and working approach :)

  5. Greg on January 23, 2012 at 20:33:

    After hours of failed attempts and mountains of psychic pain, this was the strategy that finally worked. Thanks for being a python hero!

New comment

Required
Required, but not displayed
Optional
Format using ReStructuredText (Quickref)
  • *emphasis*, **strong**, ``inline code``
  • Blockquotes: indent each line to be quoted
  • Links w/ description: `Description <URL>`_
  • Highlighted code blocks: See here