0

I have been trying unsuccessfuly to use graphviz inside a Jupyter Notebook with Python3 kernel installed via Anaconda3.

When I make a call to graphviz I get the error message:

InvocationException: GraphViz's executables not found

I begun by installing graphviz using conda. Since the exception persisted I installed again graphviz using pip.

There is a post that disccusses this problem in Stackoverflow here: Why is pydot unable to find GraphViz's executables in Windows 8?

I tried to follow the advice.

First I located the graphviz and added its path to the Environment path:

enter image description here

The path where graphviz is found in my PC is: C:\ProgramData\Anaconda3\Library\bin\graphviz

There is no bin directory inside this folder. The folder is flat without any subdirectories.

My system variables:

enter image description here

In the instructions provided in the aforementioned StackOverFlow post I am told:

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

I have installed pydotplus:

enter image description here

However when I search for pydotplus I can not find it:

enter image description here

When I call again graphviz from inside my Jupyter Notebook I get again the same exception.

from IPython.display import Image  
from sklearn import tree
import pydotplus

# Create DOT data
dot_data = tree.export_graphviz(dt_clf_4, out_file=None, 
                                feature_names= features,  
                                class_names= 'malignant')

# Draw graph
graph = pydotplus.graph_from_dot_data(dot_data)  

# Show graph
Image(graph.create_png())

InvocationException: GraphViz's executables not found
halfer
  • 19,824
  • 17
  • 99
  • 186
user8270077
  • 4,621
  • 17
  • 75
  • 140

1 Answers1

2

I am not using pydot, but it seems to be using the same executable as graphviz. For me, install graphviz using conda install python-graphviz fixes the missing graphviz executable issue.

harinsa
  • 3,176
  • 5
  • 33
  • 53