amueller / introduction_to_ml_with_python

Notebooks and code for the book "Introduction to Machine Learning with Python"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'graphviz' has no attribute 'Digraph' or 'Source'

shantimohan opened this issue · comments

When running code for "Supervised Learning":
'Digraph' is not found when running

mglearn.plots.plot_animal_tree()
'Source' is not found when running

display(graphviz.Source(dot_graph))

I have installed graphviz using Anaconda. First it gave error of not finding ENCODING. Then I installed using the following command:

conda install graphviz

Then it started giving above errors. As this didn't work, I reinstalled graphviz using the following command:

conda install -c conda-forge graphviz
That also didn't work.

In Anconda Navigator the version of graphviz is shown as 2.38.
What am I doing wrong?

you need to install both graphviz and python-graphviz