RuntimeError: failed to execute [‘dot‘, ‘-Tpdf‘, ‘-O‘, ‘test‘], make sure the Graphviz executables

本文介绍了解决在Python中使用graphviz进行图形绘制时遇到的运行时错误的方法。通过确保系统路径中包含Graphviz可执行文件,解决了'RuntimeError: failed to execute'的问题。文章还分享了在Ubuntu系统上安装Graphviz的具体命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

项目github地址:bitcarmanlee easy-algorithm-interview-and-practice
欢迎大家star,留言,一起学习进步

在python中想用graphviz画图的时候,发现报了如下异常:

RuntimeError: failed to execute ['dot', '-Tpdf', '-O', 'test'], make sure the Graphviz executables are on your systems' path

很奇怪啊。python里面明明已经安装好了graphviz。。。
经过google搜索,发现是系统也需要安装graphviz。。。

sudo apt-get install graphviz

系统安装graphviz完毕以后,代码就可以正常运行。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值