graphviz is also used in scikit-learn, A library for drawing graphs (trees).
https://www.graphviz.org/
If you use the library without installing this graphviz, ...
FileNotFoundError: [WinError 2]The specified file could not be found.
Aber
graphviz.backend.ExecutableNotFound: failed to execute ['dot', '-Tpng', '-O', 'binary_tree'], make sure the Graphviz executables are on your systems' PATH
I get angry because I can't find dot.exe
in graphviz
.
That's why I will introduce graphviz this time, As you can see from the tag, we will introduce it portablely using WinPython this time as well.
This procedure is
It will be carried out at.
A download page for Windows is available.
https://graphviz.gitlab.io/_pages/Download/Download_windows.html
If you want to install without thinking, you can choose the installer format of "graphviz-2.38.msi". I hate using the installer to pollute my system I downloaded ** "graphviz-2.38.zip" ** for portable installation.
First, extract the graphviz-2.38.zip downloaded earlier to the t
folder where you extracted WinPython.
Looking inside the unfolded ...
There is dot.exe
!
So, I will add this folder to my PATH. However, as I say many times, it pollutes the system, so make sure that the PATH is passed only when running WinPython.
It is used in such a case
The {winpythonInstallDir} \ settingts \ winpython.ini
file.
Add PATH here.
The PATH to add is {winpythonInstallDir} \ t \ graphviz-2.38 \ release \ bin \
,
Since the path of the folder where WinPython is expanded is stored in the environment variable WINPYDIRBASE
,
To add D: \ Applications \ WPy64-3810 \ t \ graphviz-2.38 \ release \ bin \
, write as follows.
Note that if you add PATH without using WINPYDIRBASE
, you will not be able to use it when you move the WinPython folder.
(If you put it in a USB memory and carry the environment, the drive letter will change.)
Now let's check if the dot.exe
in question can be used.
Double-click WinPython Command Prompt.exe
to run the dot -v
command.
thumbs up.
I tried graphviz with reference to this article ↓
https://qiita.com/msuz/items/bd41a8fe67fd56707116
WinPython, my favorite Python distribution!
Recommended Posts