I'm studying machine learning starting at Python in O'Reilly.
Anaconda is using iPython.PC is Windows 10.
An error occurred in mglearn.plots.plot_animal_tree()
in the decision tree.
I was told to install graphviz, so I installed it with pip and passed Path through the environment variable, but it didn't work because of the error below.
FileNotFoundError: [WinError2] The specified file cannot be found.
ExcutableNotFoud: failed to execute ['dot', '-Tpng', '-O', 'tmp'], make sure the Graphviz executable are on your systems' PATH
I thought I had to install graphviz on conda, so I ran conda install graphviz
, but
Note: you may need to restart the kernel to use update packages
cannot be installed.
What should we do to solve this problem?Thank you for your cooperation.
anaconda graphviz
Answer
mglean.plots.plot_animal_tree()
should display the image using the step below.
Channels
in 3) and Channels
must be the same when executing code.ExcutableNotFoud: failed to execute ['dot', '-Tpng', '-O', 'tmp'], make sure the Graphviz executable are on your systems' PATH
Step
1)Install graphviz on Win10
Add a path with dot.exe
to the environment variable Path
2)Launch Anaconda Navigator
on Win10
3)Launch CMD.exe Prompt
at ANACONDA NAVIGATOR
4)Install mglearn
on CMD
pip install mglearn
5) Install graphviz
on CMD
pip install graphviz
Confirmed Code
import mglearn
mglearn.plots.plot_animal_tree()
© 2024 OneMinuteCode. All rights reserved.