SciPy and Numpy are great packages for scientific computing.
Unfortunately, installation on Mac OS X 10.7 Lion is not a very smooth affair.
It can be a pain for moderately-experienced developers, and a nightmare for novice end-users.
The problem is compounded by the fact that both SciPy and Numpy, as well other components of a scientific computing stack that depend on them, such as matplotlib or pymc, all need to be built using the same compiler suite, build flags and architecture.
This would be fine if the pre-built distribution packages available through "
easy_install" or "
pip" for these various components were indeed all mutually compatible, or if "
pip" were smart enough to pick the correct packages for one's particular system.
But, at least the last time I tried the "
easy_install" route, this is not the case.
Numpy installed fine via "
But SciPy failed miserably half-way through.
Which meant that I had to build SciPy myself, which I finally did after some irritating false starts.
Then I tried "
This apparently worked, in that the install procedure yielded no obvious errors.
But this was misleading.
Actually trying to import the module failed due to architectural incompatibilities.
Set up the build environment by setting the following environmental variables in your session shell:
export CC=clang export CXX=clang export FFLAGS=-ff2c export LDFLAGS="-arch x86_64 -Wall -undefined dynamic_lookup -bundle" export FFLAGS="-arch x86_64"
This is the key to successfully setting up the stack. If you add other packages that depend in some way on either SciPy or Numpy in the future, you need to make sure the above environmental variables are set in your build session shell when building/installing them.
Download the Numpy source from:
Unpack, build and install it:
tar xf numpy-1.6.1.tar.gz cd numpy-1.6.1 python setup.py build python setup.py install
Clone the SciPy source repository:
git clone https://github.com/scipy/scipy.git
Build and install:
cd scipy python setup.py build python setup.py install
Download the PyMC source from:
Unpack, build, and install:
tar xf pymc-2.2.tar.gz cd pymc python setup.py build python setup.py install