当前位置: 首页 > 工具软件 > program-o > 使用案例 >

graphviz.backend.ExecutableNotFound: failed to execute ['dot', '-Tpdf', '-O', 'Digraph.gv']

从烈
2023-12-01

 

graphviz.backend.ExecutableNotFound: failed to execute ['dot', '-Tpdf', '-O', 'Digraph.gv'], make sure the Graphviz executables are on your systems' PATH

很多人会没装graphviz-2.38.msi,画出一个决策树的时候会报错,下载地址是:https://graphviz.gitlab.io/_pages/Download/Download_windows.html

画决策树的代码还要加上Graphviz2.38绝对路径的一段代码

加了环境变量好像也不管用,加了下面代码管用了

import os
os.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin/'


才能画出决策树
 

 类似资料: