graphviz.backend.ExecutableNotFound: failed to execute ['dot', '-Tpng', '-O', 't est.gv']问题解决方法

问题描述:在调用Graphviz的Source类画图时,报错信息如下图所示:

1). FileNotFoundError: [WinError 2] 系统找不到指定的文件。
2). graphviz.backend.ExecutableNotFound: failed to execute ['dot', '-Tpng', '-O', 'test.gv'], make sure the Graphviz executables are on your systems' PATH

解决方法:

输入命令import graphviz返回正常,表示python 3.6中已安装graphviz.

根据参考文献1中的提示表明不仅需要在python中成功安装graphviz,还要在系统中安装graphviz,并在系统路径里添加配置(控制面板——》系统——》高级系统设置——》系统属性——》高级——》环境变量——》系统变量——》Path中添加C:\Program Files (x86)\Graphviz2.38\bin;)。

如果是Ubuntu系统,可使用命令 sudo apt-get install graphviz 安装;

如果是Windows系统,则去官网下载安装包,目前稳定版是graphviz-2.38.msi或graphviz-2.38.zip;

如果是Mac系统,可以通过Homebrew安装。

 

 

参考文献:

1. https://stackoverflow.com/questions/35064304/runtimeerror-make-sure-the-graphviz-executables-are-on-your-systems-path-aft

2. http://www.graphviz.org/download/

  • 19
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 17
    评论
评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值