将引擎从点更改为neato时找不到graphviz PATH变量

时间:2019-05-08 07:24:43

标签: python windows graphviz neato

为什么更换引擎时出现错误?点引擎一切正常。

代码:

from graphviz import Graph

dot = Graph()
dot.engine = 'neato'

dot.node('a')
dot.node('b')

dot.edge('a', 'b')

print(dot.source)
dot.render('test-output/round-table.gv', view=True)

错误:

graphviz.backend.ExecutableNotFound: failed to execute 
['neato', '-Tpdf', '-O', 'test-output/round-table.gv'], 
make sure the Graphviz executables are on your systems' PATH

1 个答案:

答案 0 :(得分:0)

这帮助我解决了Windows上的问题:
"RuntimeError: Make sure the Graphviz executables are on your system's path" after installing Graphviz 2.38
使用.msi从https://graphviz.gitlab.io/_pages/Download/Download_windows.html安装,并手动添加到PATH。
如果您使用的是Jupyter Notebook,请重新启动您的cmd窗口,并可能重新启动网络浏览器