This step assumes you've already done HW0.2 and HW0.3.
We use some specialized and finicky Python packages in this class, and they're very difficult to install correctly on your own. Fortunately, there's a Python distribution called Canopy that makes everything Just Work™. Everyone in this class must use Canopy.*
print "Hello"
at the prompt, and it should say hi back to you. If that works, Canopy is installed — keep reading below for your hand-in.If you have Cygwin installed (which you should), then you need to do some extra work to get Canopy to work within Cygwin. Here are the steps:
Now we need to set up an alias to tell Cygwin to use Canopy's version of Python.
In Windows Explorer, open up your Cygwin home directory: C:/cygwin64/home/[Your Windows username]/
. Find the file called .bashrc
and open it with a text editor.
At the end of your .bashrc file, add this line:
alias python='C:/Users/[Your Windows username]/AppData/Local/Enthought/Canopy/User/python.exe -i'
Save the file, exit your editor, and then do the hand-in steps below in Cygwin.
Hand-in: follow these steps and then take a screenshot.
On the command line, enter the command python
to start up the Python interactive interpreter. Then enter the commands given after each >>>
below. You should see output similar to what the example shows. If it differs greatly (for example, if sys.prefix
evaluates to a non-Canopy path), your configuration has an issue that you'll need to resolve before moving on.
Enthought Canopy Python 2.7.10 | 64-bit | (default, Oct 21 2015, 09:09:19) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.6)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.prefix '/Users/jmiles/Library/Enthought/Canopy_64bit/User' >>> import numpy >>> numpy.__version__ '1.9.2' >>> numpy.eye(2) array([[ 1., 0.], [ 0., 1.]]) >>> import matplotlib >>> matplotlib.__version__ '1.4.3' >>> from PySide import QtGui >>> app = QtGui.QApplication(sys.argv) >>> wid = QtGui.QWidget() >>> wid.resize(250,150) >>> wid.setWindowTitle('Simple') >>> wid.show() >>> app.exec_()
A little gray window should pop up. Take a screenshot showing this window and the contents of your Python session. Then close the window and press Control+D to exit out of the Python interactive interpreter.
* The only exception is this: if you run Linux and you're very good at using the package manager, I'm okay with you not installing Canopy. Instead, you'll have to install (and possibly configure) all the Python packages we rely on, as well as their dependencies. I've gone this route before on my own Linux system, and it was a huge pain. I will not provide any tech support if you choose not to use Canopy.