I'm writing a Python application that includes graphviz. I would like to distribute pre-compiled binaries, done by pyinstaller. While pyinstaller can follow the modules nicely, the graphviz binaries are more tricky. I've collected all the files and added them to the binaries section in the pyinstaller spec file. This works nicely on Windows, but fails on Debian. I tried two things: (1) installed graphviz and dependencies, "dpkg -L graphviz" and "dpkg -L libgvc2" showed me all the files, I moved those to the binaries section of the pyinstaller spec file. I also included the conf file (states which plugins are registered). When the application runs, they get unpacked and sit in one directory. However, when the application tries to execute "dot", there's the error message that plugins aren't registered, and it is necessary to run "dot -c" with root rights before. Just to test, when I added the original conf file to its original place in the system ("/usr/lib/x86_64-linux-gnu/graphviz"), that error message went away, but then dot tried to find all libraries in the original system directory too, and failed. I assume the library path "/usr/lib/x86_64-linux-gnu/graphviz" is hard-coded into the debian-specific graphviz binaries in the package. (2) I tried to build a collection of executable files from source, such that they load everything else from the same directory. I compiled the source code of graphviz, tar xvvzf graphviz-13.1.0.tar.gz cd graphviz-13.1.0 LT_SYS_LIBRARY_PATH='.' ./configure # to make sure libs are searched in the same directory make make install DESTDIR=/home/jacob/downloads/graphviz-13.1.0/build/ then moved everything from that build directory into one flat package directory, ready for pyinstaller. Executing dot then gave me a segfault. I think it should be possible to have an entire graphviz mini-installation in one folder. PlantUML does it that way, and it works with the Windows version of my software too. Hence my question: How do I do that? Is there a clever combination of switches in any of the configure/make/install steps? If it is not possible, is there another way of including graphviz in a pyinstaller created software? Other than expecting the user to install it separately? Any help is very much appreciated, I'm feeling kind of stuck. P.S.: I know there's a hook for graphviz in pyinstaller; however, that's only for the "pygraphviz" python library while I'm using the "graphviz" Python library, plus it only works for Windows. Continue reading...