graphviz.backend.execute.ExecutableNotFound: failed to execute WindowsPath(‘dot‘)

当使用 graphviz 绘制有向图时,出现错误:
graphviz.backend.execute.ExecutableNotFound: failed to execute WindowsPath('dot'), make sure the Graphviz executables are on your systems' PATH

错误原因:
使用如下命令安装 graphviz,但需要安装 graphviz 软件。

pip install graphviz
conda install python-graphviz

安装 graphviz

  1. 下载 Download
  2. 双击安装

graphviz.backend.execute.ExecutableNotFound: failed to execute WindowsPath(‘dot‘)_第1张图片
根据需要勾选将 graphviz 加入系统路径
graphviz.backend.execute.ExecutableNotFound: failed to execute WindowsPath(‘dot‘)_第2张图片
选择安装位置

graphviz.backend.execute.ExecutableNotFound: failed to execute WindowsPath(‘dot‘)_第3张图片
安装成功!
graphviz.backend.execute.ExecutableNotFound: failed to execute WindowsPath(‘dot‘)_第4张图片
(没有提到的安装步骤,直接 下一步

安装结束后,需要重启让环境变量更新,否则还会出现同样的错误

你可能感兴趣的:(Python,工具,python)