Python Quick Start Guide

This guide provides basic instructions for installing Python 2.3 and all the accompanying software needed to use Python as a powerful numerical tool with easy-to-use 2D data visualization capabilities. Basic instructions for Linux, Windows, and OS X are included below. For the curious, or those who run into trouble, all of the separate software packages have detailed installation instructions as well. However, with any luck, you will be able to get by without them. There are certainly other ways of installing the same software; these instructions were written with the novice in mind.

Linux

Python
  1. Python is an interpreted, interactive, object-oriented programming language. Check if you have Python 2.3.4 installed by typing 'python -V' at the command line.
  2. If you need to install Python 2.3.4, download and build the Python 2.3.4 source or use your distribution's package manager (e.g., apt or rpm).
  3. Download Python 2.3.4 documentation documentation.
wxPython
  1. wxPython is a GUI toolkit for Python.
  2. Download and install wxPython from source, or use your package manager.
Numarray
  1. Numarray imbues Python with fast array manipulation and computational capabilities similar to those found in IDL, Matlab, or Octave.
  2. Download and install numarray-1.0.tar.gz, or use your package manager.
  3. Download the Numarray documentation.
matplotlib
  1. matplotlib is a Python 2D plotting library for producing publication-quality figures.
  2. Download and install matplotlib-0.62.4.tar.gz, or use your package manager.
  3. Read through the short matplotlib tutorial.

Windows

Python
  1. Python is an interpreted, interactive, object-oriented programming language.
  2. Download and run the Python 2.3.4 Windows installer. Choose C: as the installation directory and accept all the default settings.
  3. Download Python 2.3.4 documentation documentation.
wxPython
  1. wxPython is a GUI toolkit for Python.
  2. Download and install wxPythonWIN32 for Python 2.3. Accept all default settings.
Numarray
  1. Numarray imbues Python with fast array manipulation and computational capabilities similar to those found in IDL, Matlab, or Octave.
  2. Download and install numarray-1.0.win32-py2.3.exe. Accept all default settings.
  3. Download the Numarray documentation.
matplotlib
  1. matplotlib is a Python 2D plotting library for producing publication-quality figures.
  2. Download and install matplotlib-0.62.4-numarray1.0-win32-py2.3.exe. Accept all default settings.
  3. Open C:\Python23\share\matplotlib\.matplotlibrc in WordPad. Find the line:
    backend : TkAgg # the default backend
    and change it to:
    backend : WXAgg # the default backend
  4. Read through the short matplotlib tutorial.

OS X

Python
  1. Python is an interpreted, interactive, object-oriented programming language.
  2. Python should already be installed on your system. To check, open a Terminal window, type python -V, and then press enter, which should return Python 2.3.
  3. Download Python 2.3.4 documentation documentation.
wxPython
  1. wxPython is a GUI toolkit for Python.
  2. Download and install wxPython.
GCC
  1. Python needs the GNU Compiler Collection (GCC) to extend its capabilities with new packages. You may already have GCC installed. To find out, open a Terminal window, type gcc -v, and then press enter. If GCC is already installed, then version information will be printed out. Otherwise, you should install Xcode Tools, which includes GCC. Xcode Tools can be downloaded for free (once you've created a free member account) at Apple Developer Connection.
Numarray
  1. Numarray imbues Python with fast array manipulation and computational capabilities similar to those found in IDL, Matlab, or Octave.
  2. Download and decompress numarray-1.0.tar.gz.
  3. In a Terminal window, change directories to the Numarray directory. For example:
    cd ~/Desktop/numarray-1.0
  4. In a Terminal window, install Numarray by typing python setup.py install. This should initiate an installation process that will last a minute or two.
  5. Download the Numarray documentation.
DarwinPorts
  1. DarwinPorts is a package management system for OS X. It allows you to easily find and install a large variety of open source software. While not actually required to run any portion of Python, DarwinPorts makes it very easy to install other pieces (zlib, libpng, and freetype) that are required. Before proceeding, make sure you are logged on in an administrator account (so that you can use sudo).
  2. Download and decompress DarwinPorts.
  3. In a Terminal window, move the newly created darwinports directory to the /usr/local/ directory. For example:
    mv ~/darwinports /usr/local/
  4. Change directories to the base directory of DarwinPorts. For example:
    cd /usr/local/darwinports/base
  5. Run the DarwinPorts configuration script. For example:
    ./configure --prefix='/usr/local'
  6. Compile DarwinPorts by typing make and then pressing enter.
  7. Install DarwinPorts by typing:
    sudo make install
    You will be prompted to enter your password.
zlib
  1. zlib is a code library used for compressing data.
  2. If you've installed DarwinPorts, then you can install zlib by entering the following command:
    sudo /usr/local/bin/port install zlib
libpng
  1. libpng is a code library used for creating and manipulating portable network graphics (PNG) image files.
  2. If you've installed DarwinPorts, then you can install libpng by entering the following command:
    sudo /usr/local/bin/port install libpng
freetype
  1. freetype is a portable font engine used to render publication-quality fonts.
  2. If you've installed DarwinPorts, then you can install freetype by entering the following command:
    sudo /usr/local/bin/port install freetype
matplotlib
  1. matplotlib is a Python 2D plotting library for producing publication-quality figures.
  2. Download and decompress matplotlib-0.62.4.tar.gz.
  3. Change directories to the newly created matplotlib-0.62.4 directory. For example:
    cd ~/Desktop/matplotlib-0.62.4
  4. Edit the setup.py file found in the matplotlib-0.62.4 directory. In particular, two of the first lines after the initial comments in this file are:
    NUMERIX = 'Numeric' # or numarray
    #NUMERIX = 'numarray' # or numarray
    These lines should be changed to:
    #NUMERIX = 'Numeric' # or numarray
    NUMERIX = 'numarray' # or numarray
  5. Download .matplotlibrc and save it to your home directory.
  6. Read through the short matplotlib tutorial.
Written by Josh Lifton 2004 September 9. Thanks to Michael Broxton for help with the OS X procedure.