Computing resources

Contents:

Installing Python

All of our programming will be done using the Python programming language. We will use an implementation of Python called the Enthought Python Distribution (EPD).

To edit and run your Python programs, you have two options:

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. Browse to https://www.enthought.com/accounts/register/?next=/licenses/academic and enter your information under "Sign up for an Enthought account". Be sure to use your UW email address.
  2. You will receive a confirmation email from Enthought. Click on the provided link to activate your account. You will see a webpage that says, "Click here to request an Academic License"; click on that link.
  3. Download the appropriate file: 64-bit, 32-bit.

    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.

  4. Perform the installation. Cut-and-paste the following commands into your command shell. If you are running on a 32-bit operating system machine, replace all four instances of epd-7.3-2-rh5-x86_64 by epd-7.3-2-rh5-x86 in these instructions.

    Lines that start with # are comments, not commands. Each comment either gives more information or indicates something you should do.

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

MacOS installation

  1. Browse to https://www.enthought.com/accounts/register/?next=/licenses/academic and enter your information under "Sign up for an Enthought account". Be sure to use your UW email address.
  2. You will receive a confirmation email from Enthought. Click on the provided link to activate your account. You will see a webpage that says, "Click here to request an Academic License"; click on that link.
  3. Download the 64-bit "full installer" file.

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

  4. 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.
  5. Check that the installation was successful. Start a terminal (more information about the terminal) and run
      python --version
    
    The output should start with Python 2.7.3 -- EPD 7.3-2.
    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/
    
  6. 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. Browse to https://www.enthought.com/accounts/register/?next=/licenses/academic and enter your information under "Sign up for an Enthought account". Be sure to use your UW email address.
  2. You will receive a confirmation email from Enthought. Click on the provided link to activate your account. You will see a webpage that says, "Click here to request an Academic License"; click on that link.
  3. Browse to https://www.enthought.com/products/canopy/package-index/, click the "Repository Login" button, then click the "installers" directory.
  4. Download the appropriate file: 64-bit, 32-bit.

    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

  5. Perform the installation by double-clicking the .msi installer file that you downloaded. You now have an "Enthought" folder under your start menu.
  6. Check that the installation was successful.
    1. Start a command prompt, also known as a command shell. To do so, either run the program cmd, or follow these menus: Start Menu >> All Programs >> Accessories >> Command Prompt.
    2. In the command prompt, run
         python --version
      
      The output should start with Python 2.7.3 -- EPD 7.3.2.
  7. 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.

The operating system command line

See the document How do I use the command-line shell?.