pydot.InvocationException: GraphViz's executables not found

Chewbacca picture Chewbacca · Dec 27, 2014 · Viewed 40.7k times · Source

I try to run this example for decision tree learning, but get the following error message:

File "coco.py", line 18, in graph.write_pdf("iris.pdf") File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", line 1602, in lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", line 1696, in write dot_fd.write(self.create(prog, format)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", line 1727, in create 'GraphViz\'s executables not found' ) pydot.InvocationException: GraphViz's executables not found

I saw this post about a similar error, but even when I follow their solution (uninstall and then reinstall graphviz and pydot in the opposite order) the problem continues... I'm using MacOS (Yosemite).

Any ideas? Would appreciate the help.

Answer

Akavall picture Akavall · Jun 26, 2015

cel, answered this in the comment:

Graphviz is not a python tool. The python packages at pypi provide a convenient way of using Graphviz in python code. You still have to install the Graphviz executables, which are not pythonic, thus not shipped with these packages. You can install those e.g. with a general-purpose package manager such as homebrew

For me personally, on ubuntu 14.04, all I had to do is:

sudo apt-get install graphviz