Setting up Windows XP for Python extention module compilation

I had long thought about getting my ordereddict library in PyPI, but time and other priorities kept me from it. I would first want to move thing to bitbucket and figure out how to do wheel installs (for Windows).

A recent request if I had plans to move the source for ordereddict (which was distributed as a tarball, with the repository on my private library), prompted me to take action, because the proposed upload site was github. I have nothing against github, but since I lost changes in git (and only found out later why that is a built-in feature), I prefer mercurial and use hg-git to interact with any github based projects.

So once the account was set up (this was going to continue to live under my company account) I uploaded the orderedict repo changed the setup.py around to accomodate setuptools and not to long after version 0.4.6 was also on PyPI.

Windows

But at one time I had provided binary installs for Windows because of the problems having no compiler. Although things have improved a bit since the original development of ordereddict and you can now download free basic compilers from Microsoft, this is not a trivial exercise for the uninitiated.

Unfortunately it is also trivial for me, so here are the steps I went through setting things up under Windows XP ( Windows 7 ** does not work yet**).

Downloading

Start out with downloading the following in a new empty directory:

Installing

Python

Run the Python .msi installer by double clicking it. Select “Install for all users” and the default destination directory ( C:\Python27, as tox without my pull request does not handle non-default directories). You don’t need the documentation, the rest can come in handy.

On Windows XP run the ez_adding_python_path.py program by double clicking on it.

Double click ez_setup.py and get-pip.py.

Open a new command prompt and type in pip -V plus Return. If the PATH was properly extended then you should see the version number.

Now install some useful stuff:

pip install pytest wheel virtualenv tox

Visual Studio 2008

Install the VirtualClone Drive, with at least binding for ISO. After that you can double click the Visual Studio .iso file.

Select to install Visual C++ 2008 and follow the prompts, you don’t need the RSS feed, silverlight nor SQL.

Reboot when asked to do so.

Testing

Drag C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat in a command window to prepare the compiler.

You can now do:

pip install ruamel.ordereddict

Posted on 2014-01-20.