I have GraphViz 2.32 installed in Windows 8 and have added C:\\Program Files (x86)\\Graphviz2.32\\bin to the System PATH variable. Still pydot is unable to find its executab
you can use pydotplus instead of pydot.then follow the belows:
First, find C:\Users\zhangqianyuan\AppData\Local\Programs\Python\Python36\Lib\site-packages\pydotplus
Second, open graphviz.py
Third, find line 1925 - line 1972, find the function def create(self, prog=None, format='ps'):
Final, in the function:
find:
if prog not in self.progs:
raise InvocationException(
'GraphViz\'s executable "%s" not found' % prog)
`
if not os.path.exists(self.progs[prog]) or \
not os.path.isfile(self.progs[prog]):
raise InvocationException(
'GraphViz\'s executable "{}" is not'
' a file or doesn\'t exist'.format(self.progs[prog])
)
between the two blocks add this(Your Graphviz's executable path):
self.progs[prog] = "C:/Program Files (x86)/Graphviz2.38/bin/gvedit.exe"
after adding the result is:
if prog not in self.progs:
raise InvocationException(
'GraphViz\'s executable "%s" not found' % prog)
self.progs[prog] = "C:/Program Files (x86)/Graphviz2.38/bin/gvedit.exe"
if not os.path.exists(self.progs[prog]) or \
not os.path.isfile(self.progs[prog]):
raise InvocationException(
'GraphViz\'s executable "{}" is not'
' a file or doesn\'t exist'.format(self.progs[prog])
)
save the changed file then you can run it successfully.
you'd better save it as bmp file because png file will not work.
Here is what I did for the above mentioned problem. I'm using windows 10 os and python 3.6.5
Install PIP by clicking here
open command prompt and type command "pip install graphviz"
go to my computer(this pc) and search with the keyword "graphviz"
open the graphviz folder and copy its path and save it in notepad
In graphviz look for the bin folder and copy the folder by right click of your mouse
now again head back to my computer and search for "pydotplus"
a folder named pydotplus is displayed. Open it and paste the copy of bin folder (of Graphviz) that you copied earlier
head to control panel>system and security> system settings> advanced settings> environmental variables> add new path
add the path that you copied in notepad and click a series of "ok"
that's it now you can enjoy using graphviz
The solution is easy, you just need to download and install the Graphviz, from here.
Then set the path variable to the bin directory, in my case it was C:\Program Files (x86)\Graphviz2.38\bin
. Last, do the conda install python-graphviz
and it should work fine.