解决failed to execute [‘dot‘, ‘-Kdot‘, ‘-Tsvg‘], make sure the Graphviz executables are on your sys‘

解决failed to execute [‘dot’, ‘-Kdot’, ‘-Tsvg’], make sure the Graphviz executables are on your systems’ PATH

在做决策树实战出现以上错误,主要解决方法如下:

1.安装graphviz

我主要是从官网安装graphviz,以Windows为例,官网地址为https://graphviz.org/download/#windows,我用的是64位,可根据自己的系统进行选择安装。
解决failed to execute [‘dot‘, ‘-Kdot‘, ‘-Tsvg‘], make sure the Graphviz executables are on your sys‘_第1张图片

2.配置环境变量

电脑→属性→高级系统设置→高级→环境变量

解决failed to execute [‘dot‘, ‘-Kdot‘, ‘-Tsvg‘], make sure the Graphviz executables are on your sys‘_第2张图片
安装的路径后加\bin
设置好后,打开命令提示符,执行dot -version可查看是否配置成功,若出现以下信息说明配置成功:

3.打开命令提示符,执行pip install graphviz即可安装到python中

你可能感兴趣的:(python)