【发布时间】:2020-12-28 03:43:58
【问题描述】:
运行 .py 文件时,在尝试创建之前创建的 PNG 文件时收到此错误
pydotplus.graphviz.InvocationException: Program terminated with status: 1. stderr follows: Format: "png" not recognized. Use one of:
我不再收到任何信息。 我已经安装了 pydot、pydotplus、graphviz,但是问题一直在发生。
触发错误的代码是:
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())
graph.write_png(filename)
通过查看文件系统,我可以看到文件已创建但有 0Kb 且无法打开。因此,写入可能不会成功。
有什么建议吗?
编辑:已解决。
必须重新安装 Graphviz,在 Windows 中设置环境变量(手动),重新启动计算机并创建图像。
【问题讨论】:
标签: python graphviz pydot pydotplus