introduction_to_ml_with_python icon indicating copy to clipboard operation
introduction_to_ml_with_python copied to clipboard

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

Open shantimohan opened this issue 3 years ago • 2 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?

shantimohan avatar Jan 07 '22 19:01 shantimohan

您的邮件已收到,我将会尽快处理,谢谢。王宇凝

wanghedy avatar Jan 07 '22 19:01 wanghedy

you need to install both graphviz and python-graphviz

amueller avatar Jun 06 '23 03:06 amueller