How to distribute a Python app together with its dependencies?

A

Alessio Pace

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.
 
L

Lev Elbert

If Python for Windows you can use Py2Exe package. It works very well
in simple cases and requires a few tweaks to make it recognize some
dependencies.
 
A

Alessio Pace

If Python for Windows you can use Py2Exe package. It works very well
in simple cases and requires a few tweaks to make it recognize some
dependencies.

As I was saying above, the destination machines are all Unix.

Thank you anyway for your suggestion, I'll keep it in mind if I can to
deploy on Windows too.
 
B

BlueBird

Alessio said:
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).

I have never used it myself, but bbfreeze claims to create packaged
versions of an application, for windows and Unix :

http://pypi.python.org/pypi/bbfreeze/0.95.2


cheers,

Philippe
 
M

Mikko Viitamäki

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.
Hi,
I was reading Learning Python yesterday and I think this was mentioned:
http://peak.telecommunity.com/DevCenter/PythonEggs

I don't have experience either so no guarantees
cheers
/mikko/
 
M

Mike Driscoll

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
 
A

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top