Computing Resources

Quick links to:

Resources for practicing/learning Python basics:

CSE 160 Handouts:

Installing Python

All of our programming will be done using the Python programming language. 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.

Windows installation

  1. Browse to https://store.enthought.com/accounts/login/?next=/licenses/academic/request/ and enter your information. Be sure to use your UW email address.
  2. You will receive a confirmation email from Enthought. (If you don't receive this email response within an hour, check your spam/junk mail folder.) Click on the provided link to activate your account. You will see a webpage that says, "Activation Successful". Click on the button that says "Complete your academic license request".
  3. Follow the links to download which should take you to https://store.enthought.com/downloads/
  4. You can use the buttons at the top of the page to toggle between different operating systems and 64-bit/32-bit (although it should auto-detect your operating system for you). Click the "Download Canopy" button. Here are also direct links for Windows: 64-bit, 32-bit.

    In Windows 8, to find out whether you are running a 64-bit or 32-bit operating system, go to settings->PC info, then look at System type. For Windows 7, 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. Once installation completes, you should 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 (in windows 8 you can just search for it), or in Windows 7 follow these menus: Start Menu -> All Programs -> Accessories -> Command Prompt.
    2. In the command prompt window, type:
         python --version
      
      The output should start with Python 2.7.11 -- 64-bit.
  7. You can now run programs like python or ipython from the command line. For example, to run python, type python

Linux installation

  1. Browse to https://store.enthought.com/accounts/login/?next=/licenses/academic/request/ and enter your information. Be sure to use your UW email address.
  2. You will receive a confirmation email from Enthought. (If you don't receive this email response within an hour, check your spam/junk mail folder.) Click on the provided link to activate your account. You will see a webpage that says, "Activation Successful". Click on the button that says "Complete your academic license request".
  3. Follow the links to download which should take you to https://store.enthought.com/downloads/
  4. You can use the buttons at the top of the page to toggle between different operating systems and 64-bit/32-bit (although it should auto-detect your operating system for you). Click the "Download Canopy" button. Here are also direct links for Linux: 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.

  5. 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 instances of canopy-1.7.4-rh5-64.sh by canopy-1.5.5-rh5-32.sh 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 canopy-1.7.4-rh5-64.sh to directory $HOME/bin/install
    
       chmod +x canopy-1.7.4-rh5-64.sh
       ./canopy-1.7.4-rh5-64.sh
       # Accept the defaults whenever you are asked a question.
       # When you see "--more--", press space.
       # At end of installation, open the Canopy application to setup environment. 
    
       # Add the following line to your ~/.bashrc file (without the "#"):
       #   export PATH=${HOME}/Enthought/Canopy_64bit/User/bin:${PATH}
    
       source $HOME/.bashrc
    	
  6. Check that the installation was successful. In the command shell type:
       python --version
    
    The output should start with Python 2.7.11 -- 64-bit.
  7. You can now run programs like python or ipython from the command line. For example, to run python, type python

MacOS installation

  1. Browse to https://store.enthought.com/accounts/login/?next=/licenses/academic/request/ and enter your information. Be sure to use your UW email address.
  2. You will receive a confirmation email from Enthought. (If you don't receive this email response within an hour, check your spam/junk mail folder.) Click on the provided link to activate your account. You will see a webpage that says, "Activation Successful". Click on the button that says "Complete your academic license request".
  3. Follow the links to download which should take you to https://store.enthought.com/downloads/
  4. You can use the buttons at the top of the page to toggle between different operating systems and 64-bit/32-bit (although it should auto-detect your operating system for you). Click the "Download Canopy" button. Here are also direct links for Mac: 64-bit, 32-bit.

    To find out whether you are running a 32-bit or 64-bit operating system, see here.

  5. Installation instructions can be found here. When opening Canopy for the first time, it goes through some environment setup and then opens a window where you can manage packages, read documentation or open an editor. You can accept any defaults it asks you for there.
  6. Check that the installation was successful.
    1. Start a terminal (Finder->applications->utilities->terminal) (more information about the terminal)
    2. In the terminal window, type:
      	  python --version
      	
      The output should start with Python 2.7.11 -- 64-bit.
  7. You can now run programs like python or ipython from the command line. For example, to run python, type python

    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/
    

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.