Thursday, July 15, 2021

Python objgraph dot not found

import objgraph

import os


x = ['a', '1', [2, 3]]

filename = os.path.dirname(__file__) + '/objgraph_test.png'

objgraph.show_refs([x], filename=filename)

When I try to output a .png image file, it throw an error:

(venv)   python-codelab [master]   python3 /Users/ldu020/workspace/github.com/mrdulin/python-codelab/src/performance-optimization/memory-profile-and-objgraph/objgraph_test.py

Graph written to /var/folders/38/s8g_rsm13yxd26nwyqzdp2shd351xb/T/objgraph-4hy982i9.dot (6 nodes)

Image renderer (dot) not found, not doing anything else



BTW, nice way to check if the environment has the specified packages


(venv)   python-codelab [master]   pip3 list | grep -e 'xdot\|objgraph'

objgraph           3.4.1     

xdot               1.1  



The Great thing is that we can generate the graphviz online 


https://dreampuf.github.io/GraphvizOnline/


References

https://dreampuf.github.io/GraphvizOnline/

https://stackoverflow.com/questions/59318212/image-renderer-dot-not-found-not-doing-anything-else

No comments:

Post a Comment