[cairo] PyCairo - Crash on Windows build, in either zlib or PyCairo

CJ Kucera pez at apocalyptech.com
Mon Mar 23 08:18:30 PDT 2009

Rafael Villar Burke wrote:
> Could you, please, document what you did, so we can have enough
> documentation just in case anyone wants to offer pycairo builds in
> pygtk.org?

Yeah, no problem - I was planning on posting it on my site (for Google
to pick up) but it'd make sense to post here as well.

It turns out that it's actually quite simple, so long as you don't waste
a lot of time trying to get the autoconf stuff working in a MinGW
environment, which is where I had spent most of my time.  The page that
I found which was the most helpful:


The process which I list below is pretty much just a subset of that

1) Install MinGW using the "Automated MinGW Installer" [1]
   The boodebr.org link suggests using "Candidate" over "Stable," but
   I had installed using Stable and didn't have any problems.  That
   post's over a year old, so I'm guessing that the currently-Stable
   releases are better than they used to be, or something.

2) Create (python home)\lib\distutils\distutils.cfg with the following
      compiler = mingw32
   ... the file probably won't exist before you create it.  On my
   machine (and I imagine most machines), the python homedir is
   C:\Python26.  I suspect that this process works fine on 2.5 as well.

3) Unpack the Python module (pycairo, for instance), use a DOS command
   prompt (or MSYS [2]) to execute "python setup.py bdist_wininst"

4) That process should create a .exe installer for the python module
   inside a "dist" dir.

Clearly this method would only work for Python libraries which are
properly-packaged with a "setup.py" script.

Hope that helps,

[1] http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780

[2] MSYS is MinGW's UNIX/bash-like shell interface, which I found to be
    very comfortable to work in, coming from a UNIX background.  I
    installed version 1.0.10 (which isn't the default tab that's open)
    from MSYS-1.0.10.exe at:

WOW: Flemmy            |   "The ships hung in the sky in much the same
pez at apocalyptech.com   |    way that bricks don't." - Douglas Adams,           |     _The Hitchhiker's Guide To The Galaxy_

More information about the cairo mailing list