Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pydot.InvocationException: GraphViz's executables not found

Tags:

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.

like image 742
Chewbacca Avatar asked Dec 27 '14 11:12

Chewbacca


People also ask

How do I add Pydot to path?

Type conda install pydot graphviz in cmd, and then add the executables location directory C:\Anaconda3\pkgs\graphviz-2.38-hfd603c8_2\Library\bin\graphviz to your system path variable. That works! It works!

How do I add a graphviz to my path?

Graphviz on Windows In Advance settings, a dialogue box opens that shows the Environment Variables button. Click the button. Select the entry Path in the system variables section and add C:\Program Files (x86)\GraphvizX. XX\bin to the existing path.


2 Answers

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
like image 94
Akavall Avatar answered Nov 06 '22 04:11

Akavall


brew install graphviz
pip install -U pydotplus

... worked for me on MacOSX

like image 40
Mark Avatar answered Nov 06 '22 04:11

Mark