Tag Archives: graphviz

Mac uses graphviz package to report error failed to execute posixpath (‘dot ‘)

When using lightgbm for visualization, the graphviz package is used. The following problems are encountered when installing the graphviz package.

Error Description:

ExecutableNotFound: failed to execute PosixPath('dot'), make sure the Graphviz executables are on your systems' PATH

 

Error cause analysis:

At first, it was thought that the reason was that the graphviz module was not installed, so PIP install graphviz was used   Later, it was found that it still couldn’t be reinstalled after uninstalling with PIP uninstall graphviz
finally, it was found that the graphviz program needs to be installed first
to explain, after installing graphviz with PIP install graphviz, only the python calling interface of graphviz is installed. If you use graphviz, you also need to download the installation file of graphviz.

 

Solution:

You can install the graphviz package on the MAC using the following command

sudo port install graphviz

————————————————
reference:

https://blog.csdn.net/qq_32731311/article/details/115578820

https://graphviz.org/download/#mac

*

How to Solve graphviz run Error in Pychart

Problem: after installing graphviz, it runs normally on the command line (Python runs normally, PDF can be output normally, pop up jump to view graphics), but documents cannot be output normally on pychart and notbook.

And an error will appear in pychar:

ExecutableNotFound: failed to execute [‘dot’], make sure the Graphviz executables are on your systems’ PATH

Solution:

Add the following two new variables to the system environment variable:

GRAPHVIZ_ DOT

GRAPHVIZ_ INSTALL_ DIR

The values are bot.exe address and graphviz root directory respectively