Program terminated with status: 1. stderr follows: Format: “png“ not recognized. Use one of:

Program terminated with status: 1. stderr follows: Format: "png" not recognized. Use one of:

绘制决策树可视化图像报错

内容


InvocationException Traceback (most recent call last)
in ()
9 filled=True, rounded=True, special_characters=True)
10 graph = pydotplus.graph_from_dot_data(dot_tree)
—> 11 img2 = Image(graph.create_png())
12 display(img2)
13 graph.write_png(“dtr.png”)

C:\ProgramData\Anaconda3\lib\site-packages\pydotplus-2.0.2-py3.6.egg\pydotplus\graphviz.py in (f, prog)
1795 self.setattr(
1796 ‘create_’ + frmt,
-> 1797 lambda f=frmt, prog=self.prog: self.create(format=f, prog=prog)
1798 )
1799 f = self.dict[‘create_’ + frmt]

C:\ProgramData\Anaconda3\lib\site-packages\pydotplus-2.0.2-py3.6.egg\pydotplus\graphviz.py in create(self, prog, format)
2030 raise InvocationException(
2031 ‘Program terminated with status: %d. stderr follows: %s’ % (
-> 2032 status, stderr_output))
2033 elif stderr_output:
2034 print(stderr_output)

InvocationException: Program terminated with status: 1. stderr follows: Format: “png” not recognized. Use one of:

总之就是说:balabala……无法识别png……balabala

图示

在这里插入图片描述

解决方法

在管理员权限下的 powershell 中执行 dot -c

图示

在这里插入图片描述

参考来源

https://www.jianshu.com/p/0110bfaacab1

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 8
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值