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

图示

Program terminated with status: 1. stderr follows: Format: “png“ not recognized. Use one of:_第1张图片

解决方法

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

图示

Program terminated with status: 1. stderr follows: Format: “png“ not recognized. Use one of:_第2张图片

参考来源

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

你可能感兴趣的:(问题集,可视化,python,决策树)