pyinstaller-hooks-contrib
pyinstaller-hooks-contrib copied to clipboard
bugfix: Unable to find "/usr/sbin/neato" when adding binary and data …
…files.
Problem on Debian GNU/Linux 11 (bullseye) and Ubuntu 22.04.1 LTS:
In : os.path.realpath(shutil.which("dot"))
Out: '/usr/sbin/libgvc6-config-update'
In : os.path.dirname(os.path.realpath(shutil.which("dot")))
Out: '/usr/sbin'
Solution:
In : os.path.dirname(shutil.which("dot"))
Out: '/usr/bin'
Indeed, dot is a symlink so we want to collect the file it points to but still call it dot.
root@924c75cb9e42:/# stat /usr/bin/dot
File: /usr/bin/dot -> ../sbin/libgvc6-config-update
The comment just above however points out that on macOS, you need to resolve the symlink to get to the real graphviz installation hiding in homebrew's cellar.
For the executables, wouldn't it be safer if we just resolved each and every one using shutil.which instead of trying to resolve their directory and collecting them from it?