pycairo
is not built by setuptools, and therefore can't be installed by pip
.
As the INSTALL documentation says:
Install Procedure
-----------------
$ ./waf --help # shows available waf options
$ ./waf configure # use --prefix and --libdir if necessary
# --prefix=/usr --libdir=/usr/lib64 for Fedora 64-bit
$ ./waf build
$ ./waf install
Use
$ python3 ./waf ...
if you have python2 and python3 installed, and the default is python 2.
You can still use pip
to fetch it:
$ pip install --download=. pycairo
Downloading/unpacking pycairo
Downloading pycairo-1.10.0.tar.bz2 (246kB): 246kB downloaded
$ tar xf pycairo-1.10.0.tar.bz2
$ cd pycairo-1.10.0
$ python ./waf etc.
Just make sure you use the Python from your virtualenv, and pass the right options to the configure
command (--prefix=$VIRTUAL_ENV
should be sufficient, but don't quote me on that; you might also have to set the PYTHON
environment variable to the path to your virtualenv Python, or other things).
Another option is to use an alternate set of Cairo bindings, like cairocffi
. But that's obviously a big change, which may not be appropriate.