Wednesday, September 16, 2015

Install Cairo Graphics and PyCairo on Ubuntu 14.04 / Linux Mint 17

Cairo is a 2D graphics library implemented as a library written in the C programming language but if you'd like to use Python programming language, you should also install Python bindings for Cairo.

This guide will go through installation of Cairo Graphics library version 1.14.2 (most recent) and py2cairo Python bindings version 1.10.1 (also most recent).

1. Install Cairo

It's very easy with the following repository. Just add it, update your packages and install.

sudo add-apt-repository ppa:ricotz/testing
sudo apt-get update
sudo apt-get install libcairo2-dev

2. Install py2cairo

cd ~
git clone git://

See what's your prefix

python -c "import sys; print sys.prefix"

Install dependencies

sudo apt-get install automake pkg-config libtool


cd ~/py2cairo
./ --prefix=/usr
sudo make
sudo make install

3. Verify

>>> import cairo
>>> cairo.cairo_version_string()
>>> cairo.version

Now, you can use up-to-date versions of these softwares in your computer.

No comments: