My colleague, Jon Haddad, has a great interactive "Intro to Python and Cassandra" presentation available on GitHub.

If you want to run through this presentation on Windows though, you might run into a few challenges getting it up and running. On my Windows 7 machine with nothing installed, these are the steps I followed to try it out.

  1. If you don't already have Cassandra installed for Windows, grab a copy of the DataStax Community Edition from Planet Cassandra.
  2. Install Python 2.7.8 using the Windows installer from Python.org.
    • Let the installer add Python to your Windows PATH variable (by default, that's disabled)
  3. The changes to your PATH environment variable will may require a restart to take effect.
  4. Since Python 2.7.8 doesn't come with pip by default, install it by following the instructions here. Basically you'll:
    • Download get-pip.py from that URL
    • Run python get-pip.py from a Command Prompt.
    • This will install pip under the Scripts folder of your Python install (i.e. c:\Python27\Scripts by default)
  5. Jon suggests that you use, virtualenvwrapper to do the demo in a Python virtual environment. For Windows users, that means using virtualenvwrapper-win. You can install it via pip from a Command Prompt:
    > pip install virtualenvwrapper-win

Now you can go ahead and create the virtual environment for the tutorial and get it running. From a command prompt, you'll want to run:

> mkvirtualenv tutorial
> workon tutorial

Then go ahead and clone the repo:

> git clone git@github.com:rustyrazorblade/python-presentation.git

Then navigate to the repo and run:

> pip install -r requirements.txt

If you run into an error about vcvarsall.bat being missing, you have two options:

  1. If you've already got Visual Studio installed, you can trick Python into using compiler for the version you have installed by following these instructions on StackOverflow.
  2. You can grab the compiler for Python from Microsoft.

Then you should be to start up the tutorial in iPython Notebook by running:

> ipython notebook

This should launch a browser with the interactive tutorial up and running.

Running tutorial