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:
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.
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.
(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
python --versionand the output should start with Python 2.7.3 -- EPD 7.3-1.
To find out whether you are running a 32-bit or 64-bit operating system, see http://support.apple.com/kb/HT4287.
python --versionThe output should start with
Enthought Python Distribution -- www.enthought.com Version: 7.3-1 Python 2.7.3 |EPD 7.3-1If 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/
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.
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
python --versionThe output should start with
Enthought Python Distribution -- www.enthought.com Version: 7.3-1 Python 2.7.3 |EPD 7.3-1
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.