How to package a Python command line app?

Manfred Lotz ml_news at posteo.de
Thu Dec 9 13:35:37 EST 2021


On Thu, 9 Dec 2021 17:34:03 +0000
Barry <barry at barrys-emacs.org> wrote:

> > On 8 Dec 2021, at 18:27, Manfred Lotz <ml_news at posteo.de> wrote:
> > 
> > The are many possibilities to package a Python app, and I have to
> > admit I am pretty confused.
> > 
> > Here is what I have:
> > 
> > A Python command line app which requires some packages which are
> > not in the standard library.
> > 
> > I am on Linux and like to have an executable (perhaps a zip file
> > with a shebang; whatever) which runs on different Linux systems.
> > 
> > Different mean
> > - perhaps different glibc versions
> > - perhaps different Python versions
> > 
> > In my specific case this is: 
> > - RedHat 8.4 with Python 3.6.8
> > - Ubuntu 20.04 LTS with Python 3.8.10 
> > - and finally Fedora 33 with Python 3.9.9
> > 
> > 
> > Is this possible to do? If yes which tool would I use for this?  
> 
> Have a look at pyinstaller it knows how to collect up all your
> dependancies and build a folder of files you can distribute. It’s
> also got a single file mode that you might find useful. The end user
> does not need to install python.
> 
> I am looking at using it to build gui apps a macOs.
> 
> You will have to experiment to find out if it solves you glib case
> concerns.
> 

I played with pyinstaller which worked fine. However, it builds a
dynamic executable and thus it is glibc version dependent. Means, I
have to build different executables for differen glibc versions.

So, it seems I will have to check how executable zip archives are
supposed to work.

-- 
Manfred



More information about the Python-list mailing list