Micke redo
Micke redo

Reputation: 33

Python- plotting not available

I have tried running the code found at http://computationallegalstudies.com/2009/11/15/programming-dynamic-models-in-python-3-outbreak-on-a-network/ but at the end the following shows up:

File "/Library/Python/2.7/site-packages/igraph/drawing/__init__.py", line 446, in plot
    result = Plot(target, bbox, background=kwds.get("background", "white"))
  File "/Library/Python/2.7/site-packages/igraph/drawing/__init__.py", line 117, 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

It's a code for modelling SIR model on networks. I really need someone's help as I am not able to use a computer , a mac in this case. Thank you in advance

Upvotes: 2

Views: 2746

Answers (1)

Tamás
Tamás

Reputation: 48051

You need to install the Cairo library and its Python bindings for plotting. If you are using Homebrew, it is simply a matter of brew install cairo py2cairo, assuming that you use the system Python (which you seem to be, judging from the stack trace).

Upvotes: 2

Related Questions