美文网首页
解决RuntimeError: failed to execut

解决RuntimeError: failed to execut

作者: 佑___ | 来源:发表于2019-09-29 11:22 被阅读0次
from graphviz import Digraph
import pydotplus

dot = Digraph(comment='The Round Table')

dot.node('A', 'King Arthur')
dot.node('B', 'Sir Bedevere the Wise')
dot.node('L', 'Sir Lancelot the Brave')
dot.edges(['AB', 'AL'])
dot.edge('B', 'L', constraint='false')

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

报错如下:

RuntimeError: failed to execute ['dot', '-Tpdf', '-O', 'test-output/round-table.gv'], make sure the Graphviz executables are on your systems' path

解决方法如下:

打开网页下载 Graphviz2.38
https://graphviz.gitlab.io/_pages/Download/Download_windows.html

image.png

配置环境:
将路径 C:\Program Files (x86)\Graphviz2.38\bin 添加至环境变量

最后,重启下电脑就OK了!

相关文章

网友评论

      本文标题:解决RuntimeError: failed to execut

      本文链接:https://www.haomeiwen.com/subject/kbtoyctx.html