<p>Python 3.7版本:</p>
<pre><code>(/home/victoria/venv/py37)$ python
Python 3.7.3 (default, Mar 26 2019, 21:43:19)
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from igraph import *
>>> g = Graph.Famous("petersen")
>>> plot(g)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
...
TypeError: plotting not available
</code></pre>
<ul>
<li><a href="https://github.com/igraph/python-igraph/issues/129" rel="nofollow noreferrer">https://github.com/igraph/python-igraph/issues/129</a></li>
<li><a href="https://stackoverflow.com/questions/12072093/python-igraph-plotting-not-available">python + igraph "plotting not available"</a></li>
<li><a href="https://stackoverflow.com/questions/28970480/python-igraph-plot-not-available-cairo-already-installed">python - igraph plot not available (cairo already installed)</a></li>
</ul>
^{pr2}$
<p>现在绘制(忽略警告):</p>
<pre><code>(/home/victoria/venv/py37)$ python
Python 3.7.3 (default, Mar 26 2019, 21:43:19)
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from igraph import *
>>> g = Graph.Famous("petersen")
>>> plot(g)
(gthumb:31636): Gtk-WARNING **: 14:43:58.342: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method "RegisterClient" with signature "ss" on interface "org.xfce.Session.Manager" doesn't exist
<igraph.drawing.Plot object at 0x7f1810e36e80>
>>>
</code></pre>
<p>结果:</p>
<p><a href="https://i.stack.imgur.com/aMMb9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aMMb9.png" alt="enter image description here"/></a></p>