python + igraph "plotting not available"
igraph uses the Cairo library for plotting, so you will need Cairo and its Python interface. Chances are that Cairo is already installed on your machine (look for files named libcairo*
in /usr/lib
and /usr/lib64
), so you just need the Python interface of Cairo.
There is one catch, though. In order to compile the Python interface of Cairo, you will need Cairo's header files, which might or might not be present on your system. If they are not installed, you can download Cairo's source and get the include files from there.
I had the same problem on my MacBook so I wanted to share my solution.
I tried to install pycairo
, py2cairo
. The installation seemed to be okay but then:
- I could not
import pycairo
- igraph's plot would not work.
The following solved the igraph plotting issue:
sudo pip install cairocffi
or just
pip install cairocffi
So instead of pycairo I used cairocffi and this did the trick.