Windows: Installing Python and its scientific computing packages

Windows: Installing Python & its scientific computing packages

While the overall recommendations here will not change, the details will always be dated. These notes were written 29 March 2006 and updated 26 April 2006. If you're reading this much after these dates, you may encounter changes or, in fact, may benefit from more up-to-date procedures and packages.

These notes were developed on Windows XP.

Python

There is a relatively complete Python distribution by Enthought: Enthought Python. Install Python 2.3.5 using the installer enthon-0.9.2.exe (85.11 MB).

This distribution contains most of what we need: iPython and the SciPy, NumPy, Numeric, ScientificPython, and Python Imaging Lab (pil) packages.

Hint for pasting into iPython: Once you copied something from another application or window, use the menu that drops down from the iPython window namestripe (on left side with the Python logo). Go to Edit -> Paste.

An alternative, not yet tested, is the Activestate distribution: ActiveState Python. The upside of this distribution is that it is at Python version 2.4. The downside of this choice is that more Python support packages need to be installed, compared to the Enthought distribution.

Additional Python Packages

Assuming you used the Enthought distribution, there are several additional packages needed to complete the set of tools that we will use in the course.

Matplotlib

Download matplotlib-0.61.0.win32-py2.3.exe from here.

Notes:

VPython

VPython provides relatively easy-to-use realtime 3D graphics. Download and install VPython-2003-10-05.exe from here.

Test installation: Find the examples subdirectory. If you're in iPython, then:

cd C:/Python23/lib/python2.3/site-packages/visual/examples/
Run an example:
python lorenz.py
Exit the demo by hitting the Quit button in the window's upper righthand corner.

If you are running in iPython, it appears that quiting the graphics application not only stops the application, but also kills the iPython session. Of course, you can simply double-click on the demos in that directory to run them. This doesn't interact with your iPtyhon session, which stays running. (We're looking into this issue.)

Run another:

python gas.py

Gnuplot

Gnuplot is a widely used plotting program and it comes with an interface to Python, so that it can be used from Python. Here are instructions for installing Gnuplot.

iPython

iPython is a shell that makes working interactively with Python and developing Python programs much more convenient than dealing with the Python interpretter directly. It comes as part of the above Python distributions.

You can change iPython's default text editor (NotePad) to your favorite editor, or one that is at least more functional, by following these instructions.

Programmer's NotePad

One particularly functional and free editor is Programmer's NotePad. Take a look at these instructions to see how to install and configure it to work with iPython.

Thanks:

These notes were developed by Benny Brown and Chris Strelioff and are an adaptation of the guide for installing Python on Microsoft Windows for Jim Sethna's course.