Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
982 views
in Technique[技术] by (71.8m points)

scikit learn - Why is pydot unable to find GraphViz's executables in Windows 8?

I have GraphViz 2.32 installed in Windows 8 and have added C:Program Files (x86)Graphviz2.32in to the System PATH variable. Still pydot is unable to find its executables.

Traceback (most recent call last):
  File "<pyshell#26>", line 1, in <module>
    graph.write_png('example1_graph.png')
  File "builddist.win32eggpydot.py", line 1809, in <lambda>
    lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog))
  File "builddist.win32eggpydot.py", line 1911, in write
    dot_fd.write(self.create(prog, format))
  File "builddist.win32eggpydot.py", line 1953, in create
    'GraphViz's executables not found' )
InvocationException: GraphViz's executables not found

I found this https://code.google.com/p/pydot/issues/detail?id=65 but am unable to get the problem solved.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem is that the path to GraphViz was not found by the pydot module as shown in the traceback:

'GraphViz's executables not found'

I solved this problem on my windows 7 machine by adding the GraphViz bin directory to my computer's PATH. Then restarting my python IDE to use the updated path.

  1. Install GraphViz if you haven't already (I used the MSI download)
  2. Get the path for gvedit.exe (for me it was "C:Program Files (x86)Graphviz2.34in")
  3. Add this path to the computer's PATH
  4. One way to get to environment settings to set your path is to click on each of these button/menu options: start->computer->system properties->advanced settings->environment variables
  5. Click Edit User path
  6. Add this string to the end of your Variable value list (including semicolon): ;C:Program Files (x86)Graphviz2.34in
  7. Click OK
  8. Restart your Python IDE

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...