How to distribute a Python app together with its dependencies?

Alessio Pace alessio.pace at gmail.com
Sun Nov 30 13:22:23 CET 2008


Hi,

I have to distribute a Python application which relies on an external
library, and I'm not very fluent in this kind of stuff with Python (I
come from the Java world where I would have used the Maven build tool
to create an "assembly with dependencies" of all it is needed to run
the app), so I was wondering if someone here could give me some
suggestions :-)

The external library is generally not present on the machines where I
have to distribute my app, and the set of machines on which I have to
distribute this application is not known a priori (it is just known
they are Unix systems). In fact by means of SSH I will have to copy
(and install) the app+library and make it runnable onto the specified
destination(s).

My question is: how would you do that?  At the moment my current
solution is to make a tarball of the sources of my app + the
"distutils" archive of the external library, copy all into the target
machine, decompress and install via distutils(*) the external library,
setup some PYTHONPATH stuff on the destination machine, and finally be
able to launch the application.

(*) specifying a prefix into the user home, as I'm not root there


So in the end I was wondering if there is a more elegant way of doing
this because, as I said before, I'm not very experienced in these kind
of tasks in Python.

Thanks in advance for any suggestion or comment.

Alessio Pace.



More information about the Python-list mailing list