前提・実現したいこと
mglearn.plots.plot_animal_tree()
を実行したい
発生している問題・エラーメッセージ
lang
1 2 3--------------------------------------------------------------------------- 4AttributeError Traceback (most recent call last) 5<ipython-input-10-68d9ec4b28dc> in <module>() 6----> 1 mglearn.plots.plot_animal_tree() 7 8C:\Anaconda3\lib\site-packages\mglearn\plot_animal_tree.py in plot_animal_tree(ax) 9 7 if ax is None: 10 8 ax = plt.gca() 11----> 9 mygraph = graphviz.Digraph(node_attr={'shape': 'box'}, 12 10 edge_attr={'labeldistance': "10.5"}, 13 11 format="png") 14 15AttributeError: module 'graphviz' has no attribute 'Digraph'
該当のソースコード
lang
1import mglearn 2mglearn.plots.plot_animal_tree()
試したこと
conda install graphviz
をしました。
graphvizの場所が
C:\Anaconda3\Library\bin
にあったのでsys.path.append(C:\Anaconda3\Library\bin)
でpathを追加しました。
補足情報(FW/ツールのバージョンなど)
import graphviz
はなぜか実行できるのですが、
from graphviz import Digraph
とやると
lang
1ImportError Traceback (most recent call last) 2<ipython-input-20-b94645d457e3> in <module>() 3----> 1 from graphviz import Digraph 4 5ImportError: cannot import name 'Digraph'
と出てしまいます。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。