Installing Python

If you wish to do the programming exercises on your own computer you will need to install four software packages: the main Python language, and the packages numpy, matplotlib, and visual (also called "vpython" in some places), all of which are available for free as downloads from the web. The simplest way to install the packages is as follows.

  1. Go to this page, which is the web page for the visual package. Then click on the "download" link for your operating system, Windows or Macintosh, which will take you to the download page. (The packages are also available for users of the Linux operating system. The installation procedure is more complicated for Linux, but if you are a Linux user you probably already know what you're doing.)
  2. The download page helpfully gives a link to the correct version of the Python language itself. You should download and install Python first, before anything else. At the time of writing, the download page gives you a choice between using version 2 or version 3 of Python. Unfortunately, we cannot use the newest version 3 for this course because of compatibility issues with other software we will be using, so you should install version 2.7 (or later, but not version 3 or later). Mac users should note also that there are different versions of some of the software for different versions of the OS X operating system. You should be careful that all the software you install is designed for the same operating system version. (Software for the operating system version you are a running, or any earlier version, should work fine. Thus, if you are running OS X version 10.6, you could install software designed for 10.3, but all the software should be for version 10.3. Don't mix versions.)
  3. Having installed the Python language, you should next follow the instructions to download and install the visual package (also called "vpython"). (If you are a Windows user this will automatically install the numpy package for you as well. If you use a Mac, see step 5 below.)
  4. You also need to install the matplotlib package. To do this you should go to this page and click on the link for the latest version of matplotlib, which at the time of writing is version 1.1.0. You will be presented with a list of packages for different computers. Select and install the one that corresponds to your computer and the version of Python that you installed. For instance, you would click on matplotlib-1.1.0.win32-py2.7.exe for a Windows computer with Python version 2.7 installed.
  5. If you use a Mac, you will also need to install numpy. (If you use Windows, numpy will already have been installed for you when you installed visual.) Download the latest version of numpy from here and install.