Introduce graphviz into a portable python environment

Introduction

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, ...

image.png

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.

Installation procedure

This procedure is

It will be carried out at.

Download graphviz

A download page for Windows is available.

https://graphviz.gitlab.io/_pages/Download/Download_windows.html

image.png

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.

installation of graphviz

First, extract the graphviz-2.38.zip downloaded earlier to the t folder where you extracted WinPython.

image.png

Looking inside the unfolded ...

image.png

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.

image.png

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.

image.png

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.)

Operation check

Now let's check if the dot.exe in question can be used.

image.png

Double-click WinPython Command Prompt.exe to run the dot -v command.

image.png

thumbs up.

Can also be used with Jupyter

I tried graphviz with reference to this article ↓

https://qiita.com/msuz/items/bd41a8fe67fd56707116

image.png

in conclusion

WinPython, my favorite Python distribution!

Recommended Posts

Introduce graphviz into a portable python environment
Create a Python environment
Recommendation of building a portable Python environment with conda
Building a Python virtual environment
Building a Python environment on Mac
Building a Python environment on Ubuntu
Create a Python environment on Mac (2017/4)
Create a virtual environment with Python!
Building a virtual environment with Python 3
Build a python3 environment on CentOS7
Introduce Python 3.5.2 environment on Amazon Linux
[Pyenv] Building a python environment with ubuntu 16.04
Building a Python3 environment with Amazon Linux2
Build a python environment on MacOS (Catallina)
Create a python environment on your Mac
Let's create a virtual environment for Python
[Python] Create a virtual environment with Anaconda
Building a Python 3.6 environment with Windows + PowerShell
[Python] Create a Batch environment using AWS-CDK
I want to build a Python environment
[Mac] Building a virtual environment for Python
Creating a python virtual environment on Windows
Draw a tree in Python 3 using graphviz
Build a Python + OpenCV environment on Cloud9
Build a modern Python environment with Neovim
Building a Python development environment for AI development
Add a Python virtual environment to VSCode
Use WebDAV in a Portable Docker environment
How to create a Python virtual environment (venv)
Building a python environment with virtualenv and direnv
Python environment construction
Simply build a Python 3 execution environment on Windows
python windows environment
Build a python environment with ansible on centos6
Building a Python environment with WLS2 + Anaconda + PyCharm
ffmpeg-Build a python environment and split the video
Build a Python environment on Mac (Mountain Lion)
Environment construction (python)
[Python] Build a Django development environment with Docker
Create a python3 build environment with Sublime Text3
Build a Python development environment on your Mac
[Python] Web development preparation (building a virtual environment)
Build a simple Python virtual environment without pyenv
A memo when creating a python environment with miniconda
python environment construction
Think about building a Python 3 environment in a Mac environment
[Venv] Create a python virtual environment on Ubuntu
Python --Environment construction
Commands for creating a python3 environment with virtualenv
Work in a virtual environment with Python virtualenv.
Procedure for creating a Python quarantine environment (venv environment)
Set up a Python development environment on Marvericks
Python environment construction
Try using tensorflow ① Build python environment and introduce tensorflow
Build a Python environment with OSX El capitan
Quickly build a Python Django environment with IntelliJ
A memo for creating a python environment by a beginner
Building a Python environment on a Sakura VPS server
Create a Python execution environment on IBM i
[Docker] Create a jupyterLab (python) environment in 3 minutes!
Create a Python virtual development environment on Windows