mgedmin/objgraph

Graphs not being saved to pngs

Martmists-GH opened this issue · 7 comments

Using the example from the docs:

>>> x = []
>>> y = [x, [x], dict(x=x)]
>>> import objgraph
>>> objgraph.show_refs([y], filename="x.png")
Graph written to C:\Users\Userame\AppData\Local\Temp\objgraph-99xk348b.dot (4 nodes)
Image renderer (dot) not found, not doing anything else

Despite having graphviz and xdot installed.

Is dot.exe on your %PATH%?

The bug is probably in the _program_in_path() function. You can verify that by trying to see whether objgraph._program_in_path('dot') returns False.

Can you tell me the value of os.environ.get('PATH'), and also the actual location of dot.exe?

I am getting the same error message. For me, xdot instead of dot is in the %PATH%.
Isn't it supposed to save to a image file even if xdot is not installed?

Isn't it supposed to save to a image file even if xdot is not installed?

Yes, provided that dot is installed.

I'm still awaiting additional information (e.g. answers to my earlier questions) since I cannot reproduce this problem myself.

Oh, I just figured that dot is different from xdot, and is installed by Graphviz (not the Python package of the same name).

I don't have this problem any more after installing Graphviz and making sure dot.exe is in the %PATH%.

I mad the same mistake. When i use 'pip install graphviz', it has no dot.exe, only dot.py.

I don't have this problem any more after installing graphviz.mis from "https://graphviz.gitlab.io/_pages/Download/Download_windows.html"