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

**URL:** https://forum.graphviz.org/t/how-to-use-pyinstallerto-pack-python-programs-that-are-using-graphviz/1694
**Category:** Help
**Created:** [July 4, 2023, 8:02am UTC](https://forum.graphviz.org/t/how-to-use-pyinstallerto-pack-python-programs-that-are-using-graphviz/1694 "2023-07-04T08:02:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![diana](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@diana](https://forum.graphviz.org/u/diana)
#### Post date: [July 4, 2023, 8:02am UTC](https://forum.graphviz.org/t/how-to-use-pyinstallerto-pack-python-programs-that-are-using-graphviz/1694/1 "2023-07-04T08:02:08Z")

</div>

I am writing a python script using Graphviz. And i am using Pyinstaller to gennerate  
a .exe file like this:  
 ![image](https://global.discourse-cdn.com/graphviz/original/2X/9/97be0f905dfd98af9acb7d019a9521958ce16e7b.png)

My code is like this:

 ![image](https://global.discourse-cdn.com/graphviz/original/2X/4/4ec3a4c5b8fe91b96ba2b2a06133129668e931a2.png)

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?

Thanks!

---

<div class="post-metadata">

### Author: ![mark](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/mark/32/84_2.png) [@mark](https://forum.graphviz.org/u/mark)
#### Post date: [July 4, 2023, 10:41pm UTC](https://forum.graphviz.org/t/how-to-use-pyinstallerto-pack-python-programs-that-are-using-graphviz/1694/2 "2023-07-04T22:41:12Z")

</div>

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.
