OSError: `pydot` failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.该错误的解决

安装pip install pydot、pydot-ng、graphviz,然后可视化模型

结果出现了错误,该如何解决,该错误和Exception: "dot.exe" not found in path.往往一起出现,解决方法相近。

我的解决

pip install pydot==1.2.3

pip install pydot-ng

graphviz的安装去[网址](https://www.graphviz.org/download/)

一直next(我装在C:/Program Files (x86)/Graphviz2.38/bin/)

添加此路径到环境变量

重启电脑(不然不行)
附:我还改了pydot.py --> class Dot(Graph): --> self.prog = 'dot.exe'(原来self.prog = 'dot'),不修改也许也行

参考:https://blog.csdn.net/william_hehe/article/details/85311143
https://blog.csdn.net/sinat_38653840/article/details/84776806

原文地址:https://www.cnblogs.com/wywshtc/p/12870246.html