Cheap binary Windows eggs
August 7, 2008
(This is a post from my old blog which seems to be going offline once in a while, maybe even permanently at some point. This article is still very useful so I’ve reposted it here for other people’s and my reference.)
Thanks to Hanno Schlichting’s howto, I’ve figured out how to create Windows eggs of those packages that have C extensions. This approach doesn’t need Microsoft Visual Studio, nor does it require you to wade
through a bunch of free Microsoft downloads that don’t really work in the end anyway.
Here’s what I did:
- Installed the standard Python 2.4 distribution from the MSI package.
- Installed the MingW compiler (into the standard location
C:\MingW) - Created
C:\DocumentsandSettings\Philipp\pydistutils.cfgand put the following text in it:
[build] compiler=mingw32
This tells distutils to always use the MingW compiler whenever it has to compile something from C.
- Went to the Control Panel -> System -> Advanced tab and clicked on the Environment Variables button. There I appended the following text to the the
Pathenvironment variable, adding the Python interpreter as well as MingW’s programs to the search path:
;C:\Python24;C:\MingW\bin
Then I added another environment variabled called
HOMEwith the following value:C:\Documents and Settings\Philipp
This points distutils at the
pydistutils.cfgfile that I created earlier (you can put thepydistutils.cfgfile anywhere you want, you just need to make sure that theHOMEenvironment
variable points to the directory). - With that in place, I am able to take any tarball (e.g.
zope.interface-3.4.0.tgz), unzip it and create a Windows egg from it like so:
python setup.py bdist_egg
What’s more, with a setup like this, it is easily possible to install Zope 3 completely from eggs (e.g. using zc.buildout) even if there are no pre-built Windows eggs on the Cheeseshop. More specifically, with this setup, zopeproject (which is really just a convenience tool over zc.buildout) works like a charm on Windows now.
August 7, 2008 at 10:19 am
My tutorial is maintained at:
http://plone.org/documentation/how-to/using-buildout-on-windows
nowadays.
August 7, 2008 at 10:32 am
Thanks, Hanno. This is a great tutorial (nice screenshots!). Since it actually covers a lot more, my how-to above is probably still useful for those who just want to create binary Windows eggs and don’t care about zc.buildout and other Zope- and Plone-related stuff.
August 7, 2008 at 11:31 am
Thanks Philipp for this article. I’m a little sceptic about buildout but maybe I’ll try it now.
There are no many Zope/Plone developers working on Windows. But it is nice that you also remember about that niche.