I have been working with iGraph 0.5.2 and I am really happy with the speed and diversity of algorithms. Of course, networks need to be visualized as well. iGraph does offer visualization capabilities but you need Cairo installed. Unfortunately, installing the python bindings for Cairo requires a little bit of hacking, especially if you do not want to upgrade to Python 2.6.
and run for each library the sequence:
make test (not required and not every library supports this)
(sudo) make install
Cairo also supports PDF and SVG output but that will require additional libraries and compiling. This is the bare minimum to get Cairo to run. If you run make test on the Cairo package you are likely to have a bunch of tests failed, as far as I can tell that doesn’t really matter for iGraph but I am sure that some features of Cairo won’t work.
Now, let’s fix pycairo-1.8.8. There are two issues:
- Pycairo-1.8.8 requires Python 2.6 or higher
- Pycairo might look for the PPC shared libraries which it can’t find.
First, open configure in a text editor that does not mess with the linebreaks. I use Textwrangler for this, I tried nano first but that gave me this error
./configure: bad interpreter: No such file or directory
Open configure and go to lines: 11116 and 11150, it will read:
minver = list(map(int, \’2.6\’.split(\’.\’))) + [0, 0, 0]
and replace 2.6 with 2.5. Close the file and save it. Now we need to fix setup.py, so open it in a text editor and do the following:
Add at the top of the file:
from __future__ import with_statement
Comment import io by adding # in front of it
Go to line 76, it reads:
if sys.version_info < (2,6):
and replace 2.6 with 2.5
Save the file and close it. Now, we need to compile pycairo:
./configure LDFLAGS=”-arch i386″ (this will disable PPC support)
(sudo) make install
(sudo) python setup.py install
If everything went smooth then fire up Python and enter:
If you don’t get any errors then you have succeeded!