|
From: | Tamas Nepusz |
Subject: | Re: [igraph] igraph plot problem with python |
Date: | Sun, 7 Sep 2008 12:07:25 +0100 |
Hi Simone,
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: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)...
>>> import cairoIn 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.gzIt 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
[Prev in Thread] | Current Thread | [Next in Thread] |