/head>
Massachusetts Institute of Technology
Dept. of Electrical Engineering and Computer Science
Spring Semester, 2006
6.099: Introduction to EECS 1

Installing the 6.099 software on Windows

These instructions have been tested on Windows/XP only. Ask the staff for help if you have a different version of Windows.

First, check to see whether the Python language is already installed on your machine. If it is, then see the course staff, rather than following these instructions, so we can help you install things without messing up your current system. If Python isn't installed on your machine, then follow the instructions on this page.

A. Download the software

Download the following file (40 Mb) to your desktop: 6.099-python-robot-software.exe. Clicking on the .exe file should unpack the software and produce a folder on your desktop called 6.099-python-robot-software. (You should set "Unzip to folder:" to be your desktop folder if it indicates something else when the extractor opens.)

B. Install the Python language

  1. Open the 6.099-python-robot-software folder and double-click on Python-2.4.2.msi.

  2. In reply to the options: install the software for all users, use the default directory (C:\Python24\) and in general just click "next" to accept the defaults.

  3. Wait for the installation to finish and click "finish".

C. Add Python to your path

  1. Open "System" in your computer control panel and click the "Advanced" tab. On that screen click "Environment variables".

  2. Scroll down the list of System variables on the lower half of the window until you find a variable called "Path". Highlight it and press "Edit".

  3. Sroll to the end of the "Variable value" entry and the characters ;C:\python24. (Don't foget the initial semicolon.) Press OK and close out of the Environment variable and System Properties windows (by pressing OK for each one).

D. Check that Python works

  1. Find Python 2.4 in your menu of programs and run "Python (command line)". This should produce a window that says "Python 2.4.2 ..." and ends with a prompt (>>>)

  2. At the prompt, type
    >>> 2**10
    and press Enter. The result should be 210, or 1024. Try computing 21000 and verify that this works as well.

  3. If this works, you've (probably) successfully installed Python. Close the Python window. Ask for help if something has gone wrong.

C. Install additional python packages

  1. Re-open the 6.099-python-robot-software folder on your desktop and double click on Numeric-23.8.win32-py2.4.exe. Accept the defaults (i.e., just click "next"), wait for the installation to complete, and click "finish"

  2. Double click on PIL-1.1.5.win32-py2.4.exe Accept the defaults (i.e., just click "next"), wait for the installation to complete, and click "finish"

E. Install the PyRo software

  1. Open the window for My Computer and in it, open the folder for your local disk. In there, you should see a folder Python24. In that, open that the folder Lib (not the folder libs!). In Lib, find the folder site-packages.

  2. Keeping site-packages open, open the 6.099-python-robot-software folder on your desktop. In it, there should be a folder called pyrobot-windows-4.3.0. This should contain a single folder named pyrobot. Copy the pyrobot folder into the site-packages folder.

  3. To verify that things seem to be working, open the pyrobot folder that you just created in site-packages. In there you should find a folder bin, and in there, an application pyrobot.py. Launch pyrobot.py You should see a black window that says "Using Pyrobot ...." and a white window entitled pyrobot@your machine name with some buttons and a line at the bottom with the prompt Command:

  4. If all this works, then Pyro should be installed on your machine. Make a shortcut to the pyrobo.py application and place it on your desktop or some other convenient place.

F. Install GNU/Emacs

Skip this step if you already have the GNU/Emacs text editor installed on your machine. Download the following file (40 Mb) to your desktop: Emacs-22.0.50.1-CvsP051218-emacsw32-0.98.exe. Clicking on the .exe file should open a wizard that will guide you through the installation process.

F. Customize GNU/Emacs

  1. Re-open the 6.099-python-robot-software folder from step A and open the subfolder for-emacs. In there is a folder called put-these-files-in-site-lisp. Open that folder. In another window, open your computer's C:Program Files folder, and in there find Emacs and in there find site-lisp. Copy the files from the put-these-in-site-lisp folder into site-lisp.

  2. Back in the for-emacs-folder, you should see a file called add-this-text-to-init-file.txt. It contains the following text:
    ;;python
    (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
    (setq interpreter-mode-alist (cons '("python" . python-mode)
    				   interpreter-mode-alist))
    (autoload 'python-mode "python-mode" "Python editing mode." t)
    
    (global-font-lock-mode t)
    (font-lock-mode +1)
    

    In the "Options" drop-down menu in emacs, click on save options and note where emacs saves the file. Go to that directory and edit the created .emacs file to include the text lines above using Wordpad. Cut and paste the text to replace the text in that .emacs file.

    This file can be used to customize all sorts of Emacs behaviors. For now, it just tells Emacs to start Python editing mode when visiting file whose name ends in .py, and also has Emacs use different colors to signal Python keywords and other syntactic conventions. Ask an Emacs user about other useful things you might put in this file.

F. Try it!

Go on to a brief tour of Python and PyRo