c0fec0de / anytree

Python tree data library
Apache License 2.0
947 stars 133 forks source link

DotExporter on Windows OS cannot create a graph plot #54

Closed laubisba closed 6 years ago

laubisba commented 6 years ago

Windows 8.1 (64 bit) graphviz 2.38.0 Python 2.7.15 (32 bit) anytree 2.4.3

>dot -v dot - graphviz version 2.38.0 (20140413.2041) libdir = "C:\Program Files (x86)\Graphviz2.38\bin" Activated plugin library: gvplugin_dot_layout.dll Using layout: dot:dot_layout Activated plugin library: gvplugin_core.dll Using render: dot:core Using device: dot:dot:core The plugin configuration file: C:\Program Files (x86)\Graphviz2.38\bin\config6 was successfully loaded. render : cairo dot fig gd gdiplus map pic pov ps svg tk vml vrml xdot layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi textlayout : textlayout device : bmp canon cmap cmapx cmapx_np dot emf emfplus eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg metafile pdf pic plain plain-ext png pov ps ps2 svg svgz tif tiff tk vml vmlz vrml wbmp xdot xdot1.2 xdot1.4 loadimage : (lib) bmp eps gd gd2 gif jpe jpeg jpg png ps svg

_python anytree_pictureexport.py `from anytree import Node, RenderTree from anytree.exporter import DotExporter

udo = Node("Udo") marc = Node("Marc", parent=udo) lian = Node("Lian", parent=marc) dan = Node("Dan", parent=udo) jet = Node("Jet", parent=dan) jan = Node("Jan", parent=dan) joe = Node("Joe", parent=dan)

DotExporter(udo).to_picture("udo.png")`

I am trying to produce a graph plot with anytree (see code above) and getting the following error:

>python anytree_picture_export.py Error: dot: can't open c:\users\user\appdata\local\temp\tmpvdgutg Traceback (most recent call last): File "anytree_picture_export.py", line 12, in <module> DotExporter(udo).to_picture("udo.png") File "C:\Python27\lib\site-packages\anytree\exporter\dotexporter.py", line 229, in to_picture check_call(cmd) File "C:\Python27\lib\subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['dot', 'c:\\users\\user\\appdata\\local\\temp\\tmpvdgutg', '-T', 'png', '-o', 'udo.png']' returned non-zero exit status 2

I tried to change the file format to "pdf" and "jpg" with the same error message. Stepping through the DotExporter, the temporary file dotfile is created and the dot lines are written correctly, yet there seems to be a problem with file permission or handling.

c0fec0de commented 6 years ago

It is fixed in #47 I will release a new anytree version the next days.

richard5334 commented 5 years ago

I know it's a a bit much to ask, but would it be possible to release the latest version? The current release (2.4.3) does not include that changes... and as you know, us windows user, are not exactly the best at installing anything outside of the safe zone of _pip install name_ofpackage