How to make my python script easy portable? or how to compile into binary with all module dependencies?

andriyko picture andriyko · Dec 29, 2010 · Viewed 27.9k times · Source

Is there any way to compile python script into binary? I have one file python script which uses a lot of modules. What I would like is to have its copy on other machines (freebsd) but without installing all needed modules on every host.

What are possible solutions in such cases?

Answer

Lennart Regebro picture Lennart Regebro · Dec 30, 2010

Programs that can do what you ask for are:

But as mentioned you can also create a Package with Distribute and have the other packages as dependencies. You can then uses pip to install that package, and it will install all of the packages. You still need to install Python and pip, though.