Python FileNotFoundError:“dot.exe” not found in path

在windows平台,如果使用pycharm报错FileNotFoundError:“dot.exe” not found in path,表明你的dot.exe不在指定路径中。
按照原代码的注释说明,你可以使用两种方法来解决:
1,将dot.exe所在的bin加入PATH变量;
2,直接在代码中将dot改为dot.exe。
但是,你这么做了或者两个都做了,发现报错仍然跟以前一样,这是为什么呢?
没有人告诉过你,当你更改了这些系统参数以后,要重启电脑
是的,你没有看错,按照注释的说明操作后,重启电脑即可。
此方法适用于一系列需要更改环境变量的操作。。。

附上pydot中的注释原文。
On Windows, these have the notorious “.exe” extension that, only for the above strings, will be added automatically.
The $PATH is inherited from os.env['PATH'] and passed to subprocess.Popen using the env argument.
If you haven’t added GraphViz to your $PATH on Windows, then you may want to give the absolute path to theexecutable (for example, to dot.exe) in prog.

再附一张来自networkx的官方examples中的精美circular tree。
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值