Computing resources

All of our programming will be done using the Python programming language.

Python is not supported on the UW lab machines where you have an account. Therefore, you have two options:

Installing Python

Python is free and open-source, and is easy to install on Windows, Mac, and Linux platforms. We will use a distribution of Python that is graciously provided by Enthought Scientific Computing Solutions. Go to the appropriate section below for your operating system — Linux, MacOS, or Windows

If you have any problems, please send email to the course staff so that we can help you with this essential step.

Linux installation

  1. Enter your email address at http://www.enthought.com/products/edudownload.php. There are two blanks on that form; use the first one, not the second (“EDP for PPC”) one.
  2. Wait to receive email, then go to that link and download the appropriate file, depending on your operating system (MacOS, Linux, Solaris, Windows) and version. The file versions that include _64 in the name are for 64-bit operating systems.

    To find out whether you are running a 32-bit or 64-bit operating system, run uname -m
    If the result is x86_64, you are running a 64-bit operating system. Otherwise, you are running a 32-bit operating system.

  3. Perform the installation. Cut-and-paste the following commands into your command shell. Lines that start with # are comments, not commands. Each comment either gives more information or indicates something you should do.

    (If you are running on a 64-bit operating system machine, replace all four instances of epd-7.3-1-rh5-x86 by epd-7.3-1-rh5-x86_64 in these instructions.)

       mkdir -p $HOME/bin/install
       cd $HOME/bin/install
    
       # Download or copy the file epd-7.3-1-rh5-x86.sh to directory $HOME/bin/install
    
       chmod +x epd-7.3-1-rh5-x86.sh
       ./epd-7.3-1-rh5-x86.sh
       # Accept the defaults whenever you are asked a question.
       # When you see "--more--", press space.
    
       # Add the following line to your ~/.bashrc file:
       #   export PATH=${HOME}/bin/install/epd-7.3-1-rh5-x86/bin:${PATH}
    
       source $HOME/.bashrc
    
  4. Check that the installation was successful. Run
       python --version
    
    and the output should start with Python 2.7.3 -- EPD 7.3-1.
  5. You can now run programs like idle, python, or ipython from the command line. For example, to run IDLE, type idle

MacOS installation

  1. Enter your email address at http://www.enthought.com/products/edudownload.php. There are two blanks on that form. You most likely want to use the first one. The second one (“EDP for PPC”) is only if you are running Mac OSX 10.4 “Tiger”, which was released in April 2005 and is rarely used any more.
  2. Wait to receive email, then go to that link and download the appropriate file, depending on your operating system (MacOS, Linux, SunOS, Windows) and version. The file versions that include _64 in the name are for 64-bit operating systems.

    To find out whether you are running a 32-bit or 64-bit operating system, see http://support.apple.com/kb/HT4287.

  3. Perform the installation, as follows.
    1. Double-click the file you downloaded, to create an "EPD-7.3" folder. It contains 3 text files and also an "EPD mpkg" file.
    2. Double-click the "EPD mpkg" file.
  4. Check that the installation was successful. Start a terminal (more information about the terminal) and run
      python --version
    
    The output should start with
      Enthought Python Distribution -- www.enthought.com
      Version: 7.3-1
    
      Python 2.7.3 |EPD 7.3-1
    
    If the installation was not successful, then send email to the course staff asking for help. In your email, attach your ~/.bash_profile file, and also run this command and attach its output:
      ls -l /Library/Frameworks/Python.framework/Versions/
    
  5. You can now run programs like idle, python, or ipython from the command line.

    You can also run programs by double-clicking them. To run IDLE, either open the Enthought directory and click on the IDLE icon, or type IDLE in the spotlight search. It can take IDLE a while to start up, so be patient.

Troubleshooting: If, at some point during the quarter, you receive an error like this:

  File "<pyshell#12>", line 1, in <module>
    import matplotlib.pyplot as plt
  ...
  ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): no suitable image found.  Did find: 
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: no matching architecture in universal wrapper

then you have encountered a problem, which you can luckily work around. You received the above error while running the python program, and you instead need to run arch -i386 python — for example, if you got the error by running “python myfile.py“, you need to instead run “arch -i386 python myfile.py“.

Optional details, for the curious: The error message indicates that a certain library is only able to run on 32-bit computers, but your Mac is a 64-bit computer. The command arch -i386 program tells the Mac to emulate a 32-bit architecture when it runs program.

Windows installation

  1. Enter your email address at http://www.enthought.com/products/edudownload.php. There are two blanks on that form; use the first one, not the second (“EDP for PPC”) one.
  2. Wait to receive email, then go to that link and download the appropriate file, depending on your operating system (MacOS, Linux, SunOS, Windows) and version. The file versions that include _64 in the name are for 64-bit operating systems.

    To find out whether you are running a 32-bit or 64-bit operating system, see http://windows.microsoft.com/en-us/windows7/find-out-32-or-64-bit

  3. Perform the installation. Double-click the .msi installer file that you downloaded. You now have an "Enthought" folder under your start menu.
  4. Check that the installation was successful.
    1. Start a command prompt, or command shell, by running the program cmd; it can also be found under Start Menu >> All Programs >> Accessories >> Command Prompt.
    2. In the command prompt, run
         python --version
      
      The output should start with
        Enthought Python Distribution -- www.enthought.com
        Version: 7.3-1
      
        Python 2.7.3 |EPD 7.3-1
      
  5. You can now run programs like idle, python, or ipython from the command line.

    You can also run programs by double-clicking them. Try this, by locating the Enthought folder and running the IDLE program that is in it.