我是靠谱客的博主 安详玫瑰,这篇文章主要介绍OSError: pydot failed to call GraphViz.Please install GraphViz,现在分享给大家,希望可以做个参考。

问题:OSError: pydot failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.
下载graphviz-2.38.msi,安装完以后相应的d:/Graphviz2.38/bin目录地下就有可执行文件了。 
将d:/Graphviz2.38/bin目录加到系统环境变量中就OK啦 

做完了上述步骤,结果还是不行。可能需要在程序里加

复制代码
1
2
import os os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin'

还是不行的话,通常是因为在win下失败,错误提示是找不到“dot”程序,而不是"dot.exe"程序,这就好办了,找到pydot的源码,在pydot.py中找到类Dot
 

 

修改self.prog = 'dot'为self.prog = 'dot.exe',之后测试,成功运行例子

 

最后

以上就是安详玫瑰最近收集整理的关于OSError: pydot failed to call GraphViz.Please install GraphViz的全部内容,更多相关OSError:内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(75)

评论列表共有 0 条评论

立即
投稿
返回
顶部