pyinstaller-hooks-contrib icon indicating copy to clipboard operation
pyinstaller-hooks-contrib copied to clipboard

bugfix: Unable to find "/usr/sbin/neato" when adding binary and data …

Open jan-fuchs-fuky opened this issue 3 years ago • 2 comments

…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'

jan-fuchs-fuky avatar Nov 22 '22 07:11 jan-fuchs-fuky

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.

bwoodsend avatar Nov 22 '22 09:11 bwoodsend

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?

rokm avatar Nov 22 '22 11:11 rokm