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
|
- 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.
- 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).
- Download Python 2.3.4
documentation documentation.
|
wxPython
|
- wxPython is a GUI toolkit for Python.
- Download and
install wxPython from source, or use your package manager.
|
Numarray
|
- Numarray imbues Python with fast array manipulation and
computational capabilities similar to those found in IDL, Matlab, or
Octave.
- Download and install numarray-1.0.tar.gz, or use your package manager.
- Download the Numarray documentation.
|
matplotlib
|
- matplotlib is a Python 2D plotting library for producing
publication-quality figures.
- Download and install matplotlib-0.62.4.tar.gz, or use your package manager.
- Read
through the short matplotlib tutorial.
|
|
Windows |
Python
|
- Python is an interpreted, interactive, object-oriented programming
language.
- Download and run the Python 2.3.4 Windows
installer. Choose
C: as the installation directory and accept all the default settings.
- Download Python 2.3.4
documentation documentation.
|
wxPython
|
- wxPython is a GUI toolkit for Python.
- Download and install wxPythonWIN32 for
Python 2.3. Accept all default settings.
|
Numarray
|
- Numarray imbues Python with fast array manipulation and
computational capabilities similar to those found in IDL, Matlab, or
Octave.
- Download and install numarray-1.0.win32-py2.3.exe.
Accept all default settings.
- Download the Numarray documentation.
|
matplotlib
|
- matplotlib is a Python 2D plotting library for producing
publication-quality figures.
- Download and install matplotlib-0.62.4-numarray1.0-win32-py2.3.exe.
Accept all default settings.
- 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
- Read
through the short matplotlib tutorial.
|
|
OS X |
Python
|
- Python is an interpreted, interactive, object-oriented programming
language.
- 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 .
- Download Python 2.3.4
documentation documentation.
|
wxPython
|
- wxPython is a GUI toolkit for Python.
- Download and install wxPython.
|
GCC |
- 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
|
- Numarray imbues Python with fast array manipulation and
computational capabilities similar to those found in IDL, Matlab, or
Octave.
- Download and decompress numarray-1.0.tar.gz.
- In a Terminal window, change directories to the Numarray
directory. For example:
cd ~/Desktop/numarray-1.0
- 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.
- Download the Numarray documentation.
|
DarwinPorts
|
- 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 ).
- Download and decompress DarwinPorts.
- In a Terminal window, move the newly created
darwinports directory to the /usr/local/
directory. For example:
mv ~/darwinports /usr/local/
- Change directories to the
base directory of
DarwinPorts. For example:
cd /usr/local/darwinports/base
- Run the DarwinPorts configuration script. For example:
./configure --prefix='/usr/local'
- Compile DarwinPorts by typing
make and then pressing enter.
- Install DarwinPorts by typing:
sudo make install
You will be prompted to enter your password.
|
zlib
|
- zlib is a code library used for compressing data.
- If you've installed DarwinPorts, then you can install zlib by
entering the following command:
sudo /usr/local/bin/port
install zlib
|
libpng
|
- libpng is a code library used for creating and manipulating
portable network graphics (PNG) image files.
- If you've installed DarwinPorts, then you can install libpng by
entering the following command:
sudo /usr/local/bin/port
install libpng
|
freetype
|
- freetype is a portable font engine used to render
publication-quality fonts.
- If you've installed DarwinPorts, then you can install freetype by
entering the following command:
sudo /usr/local/bin/port
install freetype
|
matplotlib
|
- matplotlib is a Python 2D plotting library for producing
publication-quality figures.
- Download and decompress matplotlib-0.62.4.tar.gz.
- Change directories to the newly created
matplotlib-0.62.4 directory. For example:
cd ~/Desktop/matplotlib-0.62.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
- Download .matplotlibrc and save it to
your home directory.
- Read
through the short matplotlib tutorial.
|
Written by Josh Lifton 2004 September 9. Thanks to Michael Broxton
for help with the OS X procedure.
|