So I have installed the anytree package (after great effort; I had to add some environment variables on my system). Having done this I can use almost all functionalities of the anytree package - just not the one I want. I wish to use graphviz in conjunction with the anytree package in order to graph trees using the 'DotExporter' command.
I have installed graphviz; its path is C:\Users\joel\Anaconda3_2\Lib\site-packages\graphviz, and I have also added the line of code 'from anytree.exporter import DotExporter' to my Python document (in addition to the other anytree imports needed to make trees).
Therefore, having defined the root node 'root' of my tree, I should now be able to produce pngs and dot files of the tree using either of the commands 'DotExporter(root).to_picture('root.png')', however I get the following error message:
'FileNotFoundError: [WinError 2] The system cannot find the file specified'.
Does anybody know what is going on? I am using Python 3.6.2 with the engine Spyder as a part of the Anaconda distribution (I have Anaconda 3.2). I am 99% certain I have the most recent versions of anytree and graphviz.
UPDATE: So I learned that there has been a big compatibility issue between Anaconda and graphviz for about a year now and assumed that this was the problem. After trying all the solutions people suggested I still wasn't able to get my program to work so I ended up uninstalling Anaconda and instead started using PyCharm together with the standard Python interpreter. However the program still wouldn't work, so even though there are compatibility issues between Anaconda and graphviz, it turns out that wasn't the problem. I tried the program on my housemate's machine which also uses Anaconda and got the same error I had been getting.
In the end I found the following workaround: I couldn't get the 'DotExporter(root).to_picture('root.png')' command to work, but the 'DotExporter(root).to_dotfile('root.dot')' command was working. '.dot' files contain code and can be opened in Notepad (other word processing softwares will work too). Therefore I just had to find a way to graph the tree using the dot file instead of using the 'DotExporter(root).to_picture('root.png')' command. The easiest way to do this is via either of the online tools http://www.webgraphviz.com/ and http://sandbox.kidstrythisathome.com/erdos/. Just open your dot file in Notepad, copy its contents and paste it into the websites and hit generate.