Scipy

From RedwoodCenter
Revision as of 22:56, 6 September 2007 by Kilian (talk | contribs) (instructions to install scipy)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Documentation


Installation (Win)

i heard that the easiest way to install all of these packages is from here: http://code.enthought.com/enthon/

Installation (Mac)

Developer Tools

you need to install the apple developer tools that ship with OSX.

Python 2.5

you need a more recent version of python than what ships with OSX. install python 2.5 from here: http://macpython.org/packages/py25-fat/ 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
 /Library/Frameworks/Python.framework/Versions/Current/bin/python

it is a good idea to put a symbolic link to python (and other programs, see below) in your /usr/local/bin directory.

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

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)

Numpy

install numpy from the same web page http://macpython.org/packages/py25-fat/ give it a try by running 'python' and within python run the commands

 import numpy
 numpy.test()

IPython

get ipython from here: http://ipython.scipy.org/dist/ipython-0.8.1.tar.gz

 tar xvzf ipython-0.8.1.tar.gz
 python setup.py 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:

 ipython

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

 ~/.ipython/ipythonrc

Matplotlib

install matplotlib from http://macpython.org/packages/py25-fat/

you can give it a try by running

 ipython -pylab

and within ipython, run a simple plotting command like:

 plot(rand(100))

you can customize matplotlib by modifying the file

 ~/.matplotlib/matplotlibrc

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 settings:

 backend      : TkAgg
 text.usetex         : True

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

Scipy

you can essentially follow the description on this web page: http://www.scipy.org/Installing_SciPy/Mac_OS_X

afterwards, you should run (within ipython)

 import scipy
 scipy.test()

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