jupyter 决策树运行报错:failed to execute ‘dot‘, make sure the Graphviz executables are on your systems

解决步骤:

1. 下载安装对应系统的graphviz软件:Download | Graphviz

2. pip安装对应库,pip install graphviz -i https://pypi.tuna.tsinghua.edu.cn/simple

3. win10 添加环境变量


1) 添加用户环境变量:此电脑右键》》属性》》高级系统设置》》环境变量》》xx的用户变量u》》path》》新建
然后粘贴软件的安装路径+\bin ,例如:D:\Programs\Graphviz\bin


2) 添加系统环境变量:此电脑右键》》属性》》高级系统设置》》环境变量》》系统环境变量(s)》》path》》新建
然后粘贴软件的安装路径+\bin ,例如:D:\Programs\Graphviz\bin

Traceback (most recent call last): File "C:\Users\木南\AppData\Roaming\Python\Python310\site-packages\graphviz\backend\execute.py", line 81, in run_check proc = subprocess.run(cmd, **kwargs) File "C:\Users\木南\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 501, in run with Popen(*popenargs, **kwargs) as process: File "C:\Users\木南\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 969, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\木南\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1438, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] 系统找不到指定的文件。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\木南\Documents\WeChat Files\wxid_t8yeg2rocvc222\FileStorage\File\2023-06\aduet\classify.py", line 60, in <module> graph.render("decision_tree", view=True) File "C:\Users\木南\AppData\Roaming\Python\Python310\site-packages\graphviz\_tools.py", line 171, in wrapper return func(*args, **kwargs) File "C:\Users\木南\AppData\Roaming\Python\Python310\site-packages\graphviz\rendering.py", line 122, in render rendered = self._render(*args, **kwargs) File "C:\Users\木南\AppData\Roaming\Python\Python310\site-packages\graphviz\_tools.py", line 171, in wrapper return func(*args, **kwargs) File "C:\Users\木南\AppData\Roaming\Python\Python310\site-packages\graphviz\backend\rendering.py", line 324, in render execute.run_check(cmd, File "C:\Users\木南\AppData\Roaming\Python\Python310\site-packages\graphviz\backend\execute.py", line 84, in run_check raise ExecutableNotFound(cmd) from e graphviz.backend.execute.ExecutableNotFound: failed to execute WindowsPath('dot'), make sure the Graphviz executables are on your systems' PATH
06-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值