Python/PyMC Setup

Here are some notes on getting and learning Python.

Getting:

For Windows: The Enthought Python Distribution is free for “educational users at degree-granting institutions”. It includes numpy, scipy, and matplotlib. Go to the Enthought Download Page and get it if you are eligible. Install it by double-clicking and then clicking ‘Ok’ until it stops asking for approval. Then download and install the PyMC windows installer from the PyMC Downloads Page.

For Ubuntu: Type the following into a terminal:

sudo apt-get install ipython python-setuptools python-dev python-nose python-tk python-numpy python-matplotlib python-scipy python-networkx gfortran libatlas-base-dev
sudo easy_install pymc

For Macintosh: I don’t know how to use a mac, but there is a website called http://macinscience.org/ that should get you going. It is run by one of the PyMC core developers.

Testing:

Type ipython --pylab to start interactive python, or find the icon in the start menu. To make PyMC run its self-tests, do this:

import numpy
numpy.test()
import pymc
pymc.test()

Hmm, my PyMC doesn’t have any tests…

Learning:

To quickly get going in Python read this and this:

If you have used Matlab before then skim this:

Leave a Reply