Setting Up Python

In this class, we will write our code in Python 3. Python 3 is already installed on all the CMC lab machines, but if you want to work at home, you most likely won't already have the necessary tools on your computer.

Fortunately, though, the CS department's resident IT wizard, Mike Tie, has created a virtual machine for us: a virtual computer, with its own operating system and everything, that runs as a program on your own computer! This virtual machine is automatically set up with all the tools you'll need for this class. Unfortunately, since it's a whole separate operating system, it takes up a lot of space; you'll need at least 12GB of free space on your hard drive. That's really the only downside, and if you have the space, the virtual machine (or VM) is the easiest way to get set up to work at home for this class.

Mike's office is CMC 305, and he's happy to walk you through these steps if you'd like help getting set up; just email him or stop by his office.

Set Up the VM

Mike has written up a set of instructions for setting up the VM on your own computer. This involves downloading VirtualBox, the software that runs the VM, and then installing the VM's disk image (which contains the new operating system and all the tools we need for class) into VirtualBox.

So, the first thing to do is follow Mike's instructions for setting up the VM.

Once you have the VM installed, there's one initial configuration thing you have to do to get Python working properly.

  1. Start the VirtualBox program however you usually run programs on your regular computer (from the Start menu, or by finding it in Terminal, or by typing “VirtualBox&right; into Spotlight, etc.).
  2. In the main VirtualBox window, there's a column down the left side that lists all your VMs. You should have just one: CS-Ubuntu-2014_1. If it's there, double-click on it. If it isn't, you need to go back to Mike's instructions and install the VM itself from the keydrive.
  3. A new window pops up with a black screen that then shows some white text and then switches to a nice blue background. This is your VM booting up; as I said, it's a whole virtual computer, which includes booting up (and shutting down, if you ever feel like it).
  4. After a few seconds, you should see the desktop of your VM. Double-click on the “Terminal Emulator” icon; this is the same program as “Terminal” that we use on the Macs in class.
  5. In the terminal, enter exactly this command, and then hit Enter or Return:
    sudo apt-get install python3-tk
    
  6. In the terminal window, you'll be asked for your password. Mike's instructions tell you the default password for this system, but you should have already changed your password with the passwd command. Whatever the current password is for your VM (which is not necessarily the same as your regular Carleton password!), enter it here.

    If you enter the password incorrectly, the program will prompt you for it again. If you enter it correctly, then a bunch of text should get spit out. If the last line begins with “E:” (which means “Error”), something went wrong. Otherwise, you're all set!

Mount the Course Drive

You should always do work for this class on your Course drive. Your Course drive is available as long as you're connected to Carleton's network (which means that connecting by wifi in the dorms is just fine). If you're off-campus, you'll need to use VPN. If you don't have experience with that, come talk to me or Mike Tie.

If you've just booted up the VM, your Course drive may not yet be mounted. To check on it, and mount it if necessary, follow these steps:

  1. Start the Terminal Emulator program (double-click it on the desktop), then enter these commands in order (pressing Enter or Return after each one).
    • cd
    • ls
  2. In response to the second command, the terminal will show you the names of the files and folders in your home directory. Look through that list and find “HOME111”. If it's a light-blue/aqua color, then your Course drive is mounted already, and you can skip the following steps. If instead it's red, you need to mount the Course drive.
  3. To mount the course drive, now enter this command (and, once again, press Enter or Return at the end):
    • map-network-drives

    You will be asked for your Carleton username (that's the first half of your email address, before the @ sign) and your password; hit Enter or Return after each one. The program will tell you whether it succeeded in mounting the Course drive.

  4. Now double-check that “HOME111” shows up in an aqua color when you run the ls command again.