Skip to content
Chris Beaumont edited this page Aug 23, 2013 · 14 revisions

All the labs and assignments in this course are Python-based. This page provides information about configuring Python on your machine.

Step 0 The IPython notebook runs in the browser, and works best in Google Chrome. You probably want to use Chrome for assignments in this course

Recommended Method: Anaconda

The Anaconda Python distribution is an easily-installable bundle of Python and many of the libraries used throughout this class. Unless you have a good reason not to, we recommend that you use Anaconda.

Mac/Linux users

  1. Download the appropriate version of Anaconda
  2. Follow the instructions on that page to run the installer
  3. Edit your .bashrc, or .profile file in your home directory to add the following lines:
export PATH="$HOME/anaconda/bin:$PATH"
unset PYTHONPATH
  1. Test it out: open a terminal window, and type python, you should see something like
Python 2.7.5 |Anaconda 1.6.1 (x86_64)| (default, Jun 28 2013, 22:20:13) 

If Anaconda doesn't appear on the first line, you are using a different version of Python. Make sure that you correctly set the PATH in the previous step (which python should return the version of Python in the anaconda folder)

  1. Test out the IPython notebook: open a Terminal window, and type ipython notebook. A new browser window should pop up. Ipython notebook on Macs
  2. Click New Notebook to create a new notebook file A new notebook
  3. Update IPython to the newest version by typing conda update ipython at the command line

Windows Users

  1. Download the appropriate version of Anaconda
  2. Follow the instructions on that page to run the installer. This will create a directory at C:\Anaconda
  3. Test it out: start the Anaconda launcher, which you can find in C:\Anaconda or, in the Start menu. Start the IPython notebook. A new browser window should open. IPython Notebook on Windows
  4. Click New Notebook, which should open a new page. A new notebook
  5. Update IPython to the newest version by opening a command prompt, and typing conda update ipython

Installing additional libraries

Anaconda includes most of the libraries we will use in this course, but you will need to install a few extra ones:

  1. BeautifulSoup
  2. MrJob

The recommended way to install these packages is to run pip install BeautifulSoup MrJob on the command line. If this doesn't work, you can download the source code, and run python setup.py install from the source code directory. On Unix machines, either of these commands may require sudo (i.e. sudo pip install... or sudo python)

Opening IPython Notebooks

To view an IPython notebook, you must first start the IPython notebook server in the directory where the file lives. Simply navigate to this directory at the command prompt, and type ipython notebook. This will open a browser window, listing all the ipynb files in that directory.

Clone this wiki locally