igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] igraph plot problem with python


From: Simone Gabbriellini
Subject: Re: [igraph] igraph plot problem with python
Date: Sun, 7 Sep 2008 15:11:07 +0200

Hi Tamas,

Hi Simone,

I am trying to read and plot a .net file. everything run smoothly
unless I try to call the plot function: [...]

It is strange, since cairo is on my system (I use it with R)...
It's not enough to have Cairo on your system, what you need is the Python interface for Cairo as well. You can check whether you have it or not by trying to import it in the Python shell:

>>> import cairo

The result is: No module named Cairo

I have installed Cairo via Fink, but the last version is 1.0.4-1, which is quite old...

pycairo need at least >= 1.4.12 so no way to compile it...

seems to be quite intricated...

Simone

In fact, that's what igraph does in order to check whether Cairo is installed or not. In case of an ImportError, igraph creates a "fake" cairo module temporarily that just throws an exception with every single function call saying that plotting is not available.

So, anyway, make sure you have the Python interface for Cairo. If not, download it and try to compile it:

http://cairographics.org/releases/pycairo-1.4.12.tar.gz

It should compile by the usual python setup.py build && sudo python setup.py install way if you have Cairo installed (but make sure you call MacPython's python executable and not the built-in one, otherwise the Python bindings of Cairo get installed for the built- in Python and not MacPython). The one shipped with R might not be enough, though, as it is buried somewhere in a non-standard path inside /Applications/R.app/whatever, so I installed the Cairo libraries from fink and then compiled pycairo.

--
Tamas



_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help





reply via email to

[Prev in Thread] Current Thread [Next in Thread]