動かざることバグの如し

近づきたいよ 君の理想に

Pythonでmake sure the Graphviz executables are on your systems' PATH

環境

エラーの内容

import mglearn
mglearn.plots.plot_animal_tree()

ってやると

ExecutableNotFound: failed to execute ['dot', '-Tpng', '-O', 'tmp'], make sure the Graphviz executables are on your systems' PATH

ってエラーになる。 pip install graphviz は実行済み

対策

graphviz本体?を別途インストールする必要がある

Macなら

brew install graphviz

Ubuntuなら

apt install graphviz
import mglearn
import matplotlib.pyplot as plt
mglearn.plots.plot_animal_tree()
plt.show()

f:id:thr3a:20171210152443p:plain

できた