What I’m trying to do:
I am trying to create a small graph using Graphviz and save it to an anvil table row. I tested the png creation code (i.e. first 4 lines), it works in colab as expected
def create_graph():
g = Digraph('G')
g.edge('Hello', 'World')
graph = pydotplus.graph_from_dot_data(g.source)
graph.write_png('/tmp/mygraph.png')
new_file = anvil.media.from_file("/tmp/mygraph.png", "image/png", "myfile.png")
app_tables.table_5.add_row(file=new_file, filename="myfile.png")
What I’ve tried and what’s not working:
I have added graphviz and pydotplus packages, I am running into the following error
Starting server runtime… Server runtime connected.
InvocationException: GraphViz's executables not found
at /home/anvil/.env/lib/python3.10/site-packages/pydotplus/graphviz.py:1959
called from /home/anvil/.env/lib/python3.10/site-packages/pydotplus/graphviz.py:1918
called from /home/anvil/.env/lib/python3.10/site-packages/pydotplus/graphviz.py:1810
Greatly appreciate any pointers