Installing Python, pyMongo, and Bottle on Windows

I had no problem installing all of the above on my Mac. On Windows, however, it was a bit of a pain. Thinking about it, it maybe that the mac install was Python 2.7, which everyone has been there and done that, whereas the Windows install was python 3.3, which may be a little later to the party.

Anyway, what I did:

  1. Install python 3.3 from Use the msi installer
  2. Install the pymongo using the msi from > Look down the bottom to find the windows installers. I suggest you don’t do an easy_install, it won’t compile properly and will either not work at all, or will have degraded performance.
  3. Install distribute. The instructions are here. I found it easiest to install from cygwin/git-bash using:
     $ curl -O
    $ python
  4. Install pip using easy_install supplied by distribute. NB: you must do this from the DOS command line (and, it appears, be in the Scripts folder):
     C:\> cd c:\Python33\Scripts\
    C:\> easy_install pip
  5. I also installed bottle at this point.
     C:\> pip install bottle

Many experienced python developers are recommending using virtualenv. It allows you have a virtual python install where you can pip install anything without blowing up your base python install by accident. You may have to use the performance retarded pymongo as Windows 7 (32-bit) doesn’t have the c libraries needed to build the necessary modules.

Hat tip to khattam for the distribute/easy_install usage.

GIT: Find commits for a specific file

git log --stat component/src/main/resources/META-INF/spring/context-osgi.xml

 Gets you a list of all the commits including that file.

git diff $commit_hash_old $commit_hash_current component/src/main/resources/META-INF/spring/context-osgi.xml

Shows you the diffs between the old file and the one you have now.

Cross ref: git blame might be more useful. Tells you which lines of a file were changed by whom:

git blame component/src/main/resources/META-INF/spring/context-osgi.xml

6d4e6fd3 (Dick Dastardly 2012-07-26 15:28:33 +0100 24)
6d4e6fd3 (Dick Dastardly 2012-07-26 15:28:33 +0100 25) /data/error/
c3cedfe7 (Dick Dastardly 2012-06-13 16:10:19 +0100 26)
6d713a0a (Muttley 2012-10-18 13:44:33 +0100 27)
3233b294 (Peter Perfect 2012-11-07 13:16:34 +0000 28) mappingPersistenceUnit
3233b294 (Peter Perfect 2012-11-07 13:16:34 +0000 29) HSQL
c3cedfe7 (Dick Dastardly 2012-06-13 16:10:19 +0100 30) org.apache.openjpa.jdbc.sql.HSQLDictionary
c3cedfe7 (Dick Dastardly 2012-06-13 16:10:19 +0100 31) org.hsqldb.jdbc.JDBCDriver
47e39616 (Dick Dastardly 2012-06-21 14:12:40 +0100 32) jdbc:hsqldb:data/resource/lookup.db
3233b294 (Peter Perfect 2012-11-07 13:16:34 +0000 35) 1