Scipy: Difference between revisions

From RedwoodCenter
Jump to navigationJump to search
Line 130: Line 130:
=== Scipy ===
=== Scipy ===

now you are all set to compile and install scipy. download scipy here:
now you are all set to compile and install scipy. download scipy 0.6.0 here:

   tar xvzf scipy-
   tar xvzf scipy-0.6.0.tar.gz
   cd scipy-
   cd scipy-0.6.0
   python install
   python install

Revision as of 15:31, 21 September 2007


Installation (Win)

i heard that the easiest way to install all of these packages is from here:


Python 2.5

you need a more recent version of python than what ships with OSX. install python 2.5 from here: afterwards, you have to make sure that this is the python version that is actually used when you type 'python' in your terminal window. in order to chech that, type 'which python':

 % which python

in order to add /usr/local/bin to your path, put the following line into your ~/.cshrc file:

 setenv PATH /usr/local/bin:${PATH}

(this is the syntax for the cshell. if you are using the bash, you have to put something like 'export PATH=/usr/local/bin:${PATH}' into your ~/.profile file)


install numpy from the same web page give it a try by running 'python' and within python run the commands

 import numpy


get ipython from here:

 tar xvzf ipython-0.8.1.tar.gz
 python install

i recommend to link ipython into your /usr/local/bin directory:

 sudo ln -s /Library/Frameworks/Python.framework/Versions/Current/bin/ipython /usr/local/bin

now you should be able to start ipython in a terminal window:


you can customize ipython (for example the colors) by modifying the file



install matplotlib from

you can give it a try by running

 ipython -pylab

and within ipython, run a simple plotting command like:


you can customize matplotlib by modifying the file


if this file does not exist, you can get a copy here:

 mkdir ~/.matplotlib
 cp /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages/matplotlib/mpl-data/matplotlibrc ~/.matplotlib

i recommend to change the following setting:

 text.usetex : True

(of course, for it to work, you need to have latex installed)

Qt 3

install Qt 3 using fink:

 fink install qt3mac

in order for Qt applications to find the library, you have to set the following environment variable in your startup script (~/.cshrc):

 setenv DYLD_FALLBACK_LIBRARY_PATH /sw/lib/qt3mac/lib

PyQt 3

get PyQt 3 here:

 tar xvzf PyQt-mac-gpl-3.17.3
 cd PyQt-mac-gpl-3.17.3
 python -w -y qt-mt

make sure that the qtext module is mentioned as one of the modules that will be built!

 sudo make install

now you have the qt library with python bindings installed. you can change the matplotlib settings to use qt. this way, you won't need x11 any more. just edit ~/.matplotlib/matplotlibrc:

 backend : QtAgg


the installation of scipy requires that you compile some of the programs yourself.

Developer Tools

you need to install the apple developer tools that ship with OSX. all the following programs have to be compiled with gcc version 4.0

 sudo gcc_select 4.0


you need the gnu fortran compiler. you can download a binary for the gfortran 4.2.1 from here:

FFTW Libraries

FFTW are optimized libraries for fast fourier transform. download version 3.1.2 here:

 tar -xvzf fftw-3.1.2.tar.gz
 cd fftw-3.1.2
 sudo make install


now you are all set to compile and install scipy. download scipy 0.6.0 here:

 tar xvzf scipy-0.6.0.tar.gz
 cd scipy-0.6.0
 python install

afterwards, you should run (within ipython)

 import scipy

at the moment, all but 2 tests should run fine. the two remaining tests will be hopefully fixed soon.