It could be the case that MacPorts installed Cairo for MacPorts' own Python 
interpreter, while igraph is installed for the system-wide default Python 
interpreter. That's why they can't see each other. Either you'll have to 
compile and install Cairo for the system Python, or compile and install igraph 
for MacPorts' Python.

-- 
T.

From: Floriane B <[email protected]>
Reply: [email protected] <[email protected]>>, 
Help for igraph users <[email protected]>>
Date: 10 September 2014 at 17:39:20
To: [email protected] <[email protected]>>
Subject:  [igraph] Using igraph + pycairo  

Hi there, 

I would like to use cairo in order to plot some graph from igraph, but it 
somehow doesn't work. 
I work on OSX version 10.9.3. 
X-code is installed
I usually work on IDLE which version is 2.7.8
I installed igraph 
Then I installed Macports and followed a tutorial in order to install 
py27-cairo, which installed by the way the following modules : 

 bzip2 @1.0.6_0 (active)
  cairo @1.12.16_2+x11 (active)
  db46 @4.6.21_9 (active)
  db_select @0.1_2 (active)
  expat @2.1.0_0 (active)
  fontconfig @2.11.1_0 (active)
  freetype @2.5.3_1 (active)
  gdbm @1.11_0 (active)
  gettext @0.19.2_0 (active)
  glib2 @2.40.0_1 (active)
  libedit @20121213-3.0_0 (active)
  libffi @3.1_4 (active)
  libiconv @1.14_0 (active)
  libpixman @0.32.6_0 (active)
  libpng @1.6.12_0 (active)
  libxml2 @2.9.1_0 (active)
  ncurses @5.9_2 (active)
  openssl @1.0.1i_0 (active)
  perl5 @5.12.4_0+perl5_16 (active)
  perl5.16 @5.16.3_0 (active)
  py-cairosvg_select @0.1_0 (active)
  py27-cairo @1.10.0_3+x11 (active)
  py27-cairosvg @1.0.9_0 (active)
  python27 @2.7.8_1 (active)
  python_select @0.3_3 (active)
  sqlite3 @3.8.6_0 (active)
  xorg-kbproto @1.0.6_0 (active)
  xorg-libpthread-stubs @0.3_0 (active)
  xorg-libX11 @1.6.2_0 (active)
  xorg-libXau @1.0.8_0 (active)
  xorg-libxcb @1.11_0+python27 (active)
  xorg-libXdmcp @1.1.1_0 (active)
  xorg-libXext @1.3.3_0 (active)
  xorg-renderproto @0.11.1_0 (active)
  xorg-xcb-proto @1.11_0+python27 (active)
  xorg-xcb-util @0.3.9_0 (active)
  xorg-xextproto @7.3.0_0 (active)
  xorg-xproto @7.0.26_0 (active)
  xrender @0.9.8_0 (active)
  xz @5.0.5_0 (active)
  zlib @1.2.8_0 (active)

I can import igraph and use some of its characteristics (like create a graph) 
but when I try to plot it, I got the "plotting not available" error, as follow 
: 

>>> from igraph import * 
>>> g = Graph.Famous("petersen")
>>> plot(g)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/igraph/drawing/__init__.py", line 
458, in plot
    result = Plot(target, bbox, background="white")
  File "/Library/Python/2.7/site-packages/igraph/drawing/__init__.py", line 
129, in __init__
    self._surface_was_created = not isinstance(target, cairo.Surface)
  File "/Library/Python/2.7/site-packages/igraph/drawing/utils.py", line 396, 
in __getattr__
    raise TypeError("plotting not available")
TypeError: plotting not available

Being new to this world, I absolutely don't know what I did wrong. 
I tried to import the modules too, but it doesn't seem to recognize them. 
>>> import cairo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named cairo

Does someone know what I can do to resolve this ? Thank you in advance for your 
help ! 
Cordially, 

Floriane
_______________________________________________  
igraph-help mailing list  
[email protected]  
https://lists.nongnu.org/mailman/listinfo/igraph-help  
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to