How to use PyInstallerto pack python programs that are using Graphviz?

I am writing a python script using Graphviz. And i am using Pyinstaller to gennerate
a .exe file like this:

My code is like this:

It works fine in my local environment, but when i run the .exe file in another environment that doesn’t install Graphviz,it will show error like this:

graphviz.backend.execute.ExecutableNotFound: failed to execute WindowsPath(‘dot’), make sure the Graphviz executables are on your systems’ PATH
[13228] Failed to execute script ‘GraphvizTest’ due to unhandled exception!

Is there any way to pack Graphviz using Pyinstall?


Graphviz (dot) is a separate executable binary, not python code. You should ask the PyInstall people about bundling executables, we don’t know anything about PyInstall here.