How to distribute a Python app together with its dependencies?

Alessio Pace alessio.pace at gmail.com
Mon Dec 1 18:35:31 CET 2008


On 1 Dic, 15:21, Mike Driscoll <kyoso... at gmail.com> wrote:
> On Nov 30, 6:22 am, Alessio Pace <alessio.p... at gmail.com> wrote:
>
>
>
> > 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.
>
> I recommend GUI2Exe, a nice wrapper to py2exe, py2app, PyInstaller,
> cx_Freeze and bbFreeze:
>
> http://code.google.com/p/gui2exe/
>
> I've only used the py2exe portion of the program, but it works great
> and the developers behind the project are very responsive and helpful.
>
> Mike

Hi all and thanks for the replies.  Apparenlty I managed to make the
standalone application with bbfreeze (used directly), I still have to
tune a little bit how it can pack in it also classes which are loaded
dynamically, and which from a static examination of the code are not
found then...

I'll try to give a look at GUI2Exe also, thank you for the suggestion.

Regards,
Alessio Pace.



More information about the Python-list mailing list