How do you install PyCairo (Cairo for Python) on Windows?

Adding the following for completeness - joaquin's answer above provides a simpler route (and Python 3 support).


Please see the following tutorial:

http://www.cs.rhul.ac.uk/home/tamas/development/igraph/tutorial/install.html

(also hosted at http://hal.elte.hu/~nepusz/development/igraph/tutorial/install.html).

I asked the question above, so that I could answer it myself. Hopefully people in a similar situation in future will find this post :)

While Googling "pycairo install windows" does give the above link, it is presented below some rather unhelpful pages, and it's also not particularly obvious that igraph documentation will be applicable.

Eventually I got as far as installing PyCairo (from the GNOME link in the question), without Cairo itself. This gave me a DLL import error when I tried to use it. Fortunately, a question relating to this error exists on StackOverflow:

pycairo "ImportError: DLL load failed: The specified module could not be found." even after DLLs installed

This question discusses the excellent tutorial from Tamas, linked above, which is all I needed to get up and running.


You should try windows binary installers from Gohlke repository for pyCairo and py2Cairo.

I never used pyCairo myself but took 4 minutes to install and get my first png example file done.