OSError:`pydot` failed to call GraphViz.(解决办法)

OSError: pydot failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.

环境:win 10,,,python3.7
刚安装完graphviz-2.38

windows系统下,在 keras里面绘图时,如果没有导入过pydot和 graphviz,在运行时会报告" Failed to import pydot. You must install pydot"类似的错误,并且提示你 pip install pydot,可是 pip install之后,又会提示你找不到 graphviz。

然后 pip install graphv后发现没用,网上搜索的解决方案大都是直接官网下载 graphy后并且加入系统path变量,但是最后如果倒霉的话有可能发现还是报同样的错。还是会报告 pydot找不到 graphviz( pydot failed to call Graphviz)

其实是pydot的原因,由于pydot已经停止开发了,python3.7已经用不起来。
解决办法:

第一步:先卸载掉已经安装的pydot:

pip uninstall pydot 

第二步:安装pydotplus

pip install pydotplus 

然后找到 keras里面的 utils\vis_utils.py,把里面的pydot的都替换成 pydotplus
在这里插入图片描述

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值