I'm trying to create a .deb installer which saves the binary in the /usr/bin directory, and the external files in the /usr/lib/ directory. The installer works, except the binary is looks for files in the same directory, which of course are not there.

The binary and library files were created with PyInstaller, and packaged with dpkg. I'm not sure if there is a function in PyInstaller that can look for external files (not as far as I can tell), or is this something that can be done in dpkg.

Would a symbolic link work, keeping the actual binary in the same directory as the external files?

  • this is something that needs to be done in your program. modify it to look in the right directory (i.e. under /usr/lib) for its "external" files. – cas Oct 9 '19 at 2:26
  • The files it's looking for are automatically generated by pyinstaller, and so is the binary. Sounds like I might be out of luck on this one, unless pyinstaller has an option to look in a different directory but I've been searching for hours and haven't found anything. – Gacekky1 Oct 9 '19 at 2:32
  • if you're making deb packages then you probably shouldn't use pyinstaller. build a deb package instead. maybe use python-stdeb or python3-stdeb. and maybe use debdry too, which further automates the production of .deb python packages. – cas Oct 9 '19 at 2:46
  • I'll check those out. Pyinstaller seems to be very limited. The binary created ALWAYS looks in the current directory for the python library files. I'm also not dead set on creating a .deb package either, I would prefer something that was as "cross-distribution" as possible. But as this is just a supplementary test utility, I've already wasted too much time on it... I'm tempted to just bundle the pyinstaller output in a tarball and just distribute it that way. – Gacekky1 Oct 9 '19 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.