pygraphviz布局IOerror

时间:2015-07-03 11:55:34

标签: python pygraphviz

我尝试使用pygraphviz打印图表。我运行以下代码并得到以下错误。 代码:

import pygraphviz as pgv

G=pgv.AGraph("k5_attributes.dot")
G.layout(prog = 'neato')
G.draw('file.png')

错误:

Traceback (most recent call last):
  File "./test.py", line 22, in <module>
    G.layout(prog = 'neato')
  File "/usr/lib64/python2.7/site-packages/pygraphviz/agraph.py", line 1359, in layout
    data = self._run_prog(prog, ' '.join([args, "-T", fmt]))
  File "/usr/lib64/python2.7/site-packages/pygraphviz/agraph.py", line 1336, in _run_prog
    raise IOError(b"".join(errors))
IOError: /usr/bin/neato: Symbol `MemTest' has different size in shared     object, consider re-linking

我安装了pydot,matplotlib,pygraphviz,numpy,python-devel,cairocffi。

如果有人知道问题来自

,请感谢您

1 个答案:

答案 0 :(得分:1)

错误消息说当程序运行/usr/bin/neato时(特别是/usr/bin/neato -Tpng ... neato有问题。&#34; neato&#34;是&#34; graphviz&#34;的一部分。

您可以通过运行来验证这一点:

neato -Tpng k5_attributes.dot -o example.png

您可能会收到相同的消息:

Symbol `MemTest' has different size in shared     object, consider re-linking

通常你可以通过卸载&#34; graphviz&#34;来解决这个问题。然后重新安装它。这将导致事情重新链接。但为了安全起见,我还首先卸载pygraphviz,然后在安装&#34; graphviz&#34;之后重新安装