-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyInstaller: Unable to find '/usr/sbin/neato' when adding binary and data files #705
Comments
The symlink following makes sense with the way homebrew package it but not Ubuntu. I suppose that we just try both resolved and unresolved |
Maybe we could check if resolved |
What I cannot understand is, when I set |
You also need to ensure that dynamic plugins for graphviz are collected, from wherever they are in your distribution package's layout:
EDIT: that would be from |
I tried adding them using I'll retry using |
Try I see we are failing to collect those plugins because while we correctly determine their location, pyinstaller-hooks-contrib/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pygraphviz.py Lines 62 to 64 in 5694f23
we assume that they have unversioned pyinstaller-hooks-contrib/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pygraphviz.py Line 60 in 5694f23
|
I modified the hook-pygraphviz.py in this way: |
Any updates on this? I tried adding to my binaries in my .spec file
It still searches for /usr/sbin/neato When i change the hook as below
it fails with
|
I am using PySide6 and pygraphviz to create a simple three widget desktop application. When I use
pyinstaller --onefile --noconsole stackedAPP.py
, PyInstaller throws me this error:Unable to find '/usr/sbin/neato' when adding binary and data files.
It seems that PyInstaller cannot find any of the pygraphviz layouts, not just neato because I tried using other layouts too. This is not an isolated issue, as I found in this older post, but there was no answer so I had to ask again.A similar PyInstaller error here seemed to have been resolved after modifying the hooks for the package, so I tried to look into hook-pygraphviz.py.
It seemed to me that the error lies in the line:
graphviz_bindir = os.path.dirname(os.path.realpath(shutil.which("dot")))
which returns/usr/sbin
Upon further investigation, I found that
shutil.which('dot')
returns/usr/bin/dot
which is actually correct (having manually confirmed it). But the result ofos.path.realpath('/usr/bin/dot')
is actually something else entirely:So the reason why PyInstaller cannot find neato in /usr/sbin is because it is not in /usr/sbin, and this is why it is searching in /usr/sbin in the first place.
So I decided to manually modify the hook and set the path as
graphviz_bindir = '/usr/bin'
This helped and PyInstaller compiled successfully, but when I use the application, it crashes when it enters the stage where it is using pygraphviz and this is the error message I see:
I'm not sure how to proceed from here. I am using VirtualBox to run Ubuntu-23.10 on which I am running this process. When I installed graphviz and pygraphviz I used:
as recommended in this documentation.
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: