Please use pydotplus instead of pydot
Find:C:\Users\zhangqianyuan\AppData\Local\Programs\Python\Python36\Lib\site-packages\pydotplus
Open graphviz.py
Find line 1925 - line 1972, find the function:
def create(self, prog=None, format='ps'):
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.