且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Anytree和graphviz在python中渲染树.无法打开文件

更新时间:2023-11-10 13:28:28

我只是遇到了这个问题.经过2个小时的调试,我发现在Windows下,必须在dotexporter.py中将delete标志设置为False.转到"dotexporter.py"中的第224行,并进行以下更改.似乎是源文件中的错误.这对我有用:

I just ran into this problem. After 2 hours of debugging, I found out for Windows, you have to set the delete flag to False in dotexporter.py. Go to line 224 in "dotexporter.py" and make the following change. It seems like a bug in the source file. This worked for me:

 with NamedTemporaryFile("wb", delete=False) as dotfile: