I've installed py2cairo using brew, but keep getting errors when trying to plot with igraph. I get the following error:
>>> import igraph as ig
>>> from igraph import *
>>> UG = ig.Graph()
>>> UG.add_vertex('a')
>>> UG.add_vertex('b')
>>> UG.add_vertex('c')
>>> UG.add_vertex('d')
>>> UG.add_edge('a','d')
>>> UG.add_edge('a','c')
>>> UG.add_edge('b','c')
>>> UG.add_edge('b','a')
>>> layout = UG.layout_kamada_kawai()
>>> plot(UG,layout = layout)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../anaconda/lib/python2.7/site-packages/igraph/drawing/__init__.py", line 427, in plot
result = Plot(target, bbox, background="white")
File ".../anaconda/lib/python2.7/site-packages/igraph/drawing/__init__.py", line 122, in __init__
self._surface_was_created = not isinstance(target, cairo.Surface)
File ".../anaconda/lib/python2.7/site-packages/igraph/drawing/utils.py", line 396, in __getattr__
raise TypeError("plotting not available")
TypeError: plotting not available
brew probably installs py2cairo for its own Python, while you are running igraph under Anaconda Python. A module installed for one Python distribution on your machine will not appear magically under the other Python distribution, so you'll either have to get py2cairo for Anaconda Python or compile the Python interface of igraph for Homebrew's Python.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With