Packaging and deployment of standalone Python applications?

Laura Creighton lac at openend.se
Tue Sep 15 08:04:19 EDT 2015


>On Monday, September 14, 2015 at 8:58:51 AM UTC+2, Kristian Rink wrote:

>> Folks; coming from a server-sided Java background, I'm recently
>> exploring frameworks such as cherrypy or webpy for building RESTful
>> services, which is quite a breeze and a pretty pleasant experience;
>> however one thing so far bugs me: Using Java tooling and libraries
>> such as DropWizard, it is pretty straightforward to build an
>> "all-inclusive" application containing (a) all code of my own, (b)
>> all required dependencies, (c) all other resources and, if
>> required, even (d) a Java virtual machine in one large .zip file
>> which can easily be copied to a clean Linux VM, unzipped and
>> started there.  Are there ways of doing so using Python, too? I'd
>> like to set up a project structure / working environment that
>> includes all Python 3rd party libraries, my own code and maybe even
>> a "standard" Python runtime for 64bit Linux systems (to not depend
>> too much on what version a certain Linux distribution actually
>> ships) and focus on doing deployment to various machines at best by
>> simply copying these packages around.

Your main problem may not be technical, but political.  PyInstaller
will do what you want, and docker is really really interesting, but
many linux users really detest the idea of getting a huge package
which duplicates stuff they already have installed on their system.
And it isn't something they are used to -- it is rarely done.
Instead, they will want you to send them a .deb or a .rpm (whatever
their OS package manager wants) or they will want a PyPI package.

If you are distributing them python source, then rather than have you
build them an app, they are more likely to want instructions for what
are the dependencies so they can build your app itself, and also
control whether or not to install the dependencies you require
system-wide or in a virtualenv.

You know your own situation best, but if you are aiming for widespread
adoption by linux users everywhere, well, I am just warning you that
they aren't going to like it.  (Unless docker, which is very new,
turns into The Next Big Thing, which I suppose always could happen.)

Laura



More information about the Python-list mailing list