Install Cairo Graphics and PyCairo on Ubuntu 14.04 / Linux Mint 17
By Güngör Budak
- One minute read - 143 wordsCairo 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).
Install Cairo
It’s very easy with the following repository. Just add it, update your packages and install.
1sudo add-apt-repository ppa:ricotz/testing
2sudo apt-get update
3sudo apt-get install libcairo2-dev
Install py2cairo
1cd ~
2git clone git://git.cairographics.org/git/py2cairo
See what’s your prefix
1python -c "import sys; print sys.prefix"
2/usr
Install dependencies
1sudo apt-get install automake pkg-config libtool
Build
1cd ~/py2cairo
2./autogen.sh --prefix=/usr
3./configure
4sudo make
5sudo make install
Verify
1python
2>>> import cairo
3>>> cairo.cairo_version_string()
4'1.14.2'
5>>> cairo.version
6'1.10.1'
Now, you can use up-to-date versions of these softwares in your computer.