I need to generate a tree from a dictionary with python AnyTree package.so I have a dictionary like below structure.
data = {'name': 'xyz',
'children': [{'name': 'node1',
'children': [{'name': 'node2'}]}]}
This dictionary can grow as the program executes.issue that I'm facing right now is when i try to export the tree as a png with DotExporter(root).to_picture("data.png")
it throws a file not found error like below
Traceback (most recent call last):File "C:/Users/.../data_modeling.py", line 88, in<module>creating_tree(main)
File "C:/Users/.../data_modeling.py", line 66, in creating_tree
DotExporter(root).to_picture("data.png")
File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\lib\site-packages\anytree\exporter\dotexporter.py", line 229, in to_picture
check_call(cmd)
File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 323, in check_call
retcode = call(*popenargs, **kwargs)
File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 304, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1155, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
I have graphviz package installed and i am on python 3.7 with windows.
however using DotExporter(root).to_dotfile('root.dot')
I can export the tree as a dot file and using an online converter I can convert dot file to an image.
but I need to export this as a png from my program.
I have already googled for similar issues and did all the suggestions and solutions there.any help or suggestion would be great,any other tree graphing tool also would be okay.