How to pack the python files that I use so that I can distribute them with my application and have as few dependencies as possible

How to compile python packages that I use so that I can distribute them with my application and have as few dependencies as possible, and also does not conflict with another version of lib / version that is already on my system.

LE: Sorry, I forgot to indicate. I will do it on linux. And I'm not talking about making my application an installable file, for example deb / rpm, etc., But how to organize my files like this, for example, I will use cherrypy and sqlalchemy. I will send them with my application, and will not put the user through the pain of installing all the dependencies on my own.

+4
source share
4 answers

Users can start the system from a startup script, and the script can preinstall pythonpath in order to first install your versions. For example, if you placed CherryPy, SQLAlchemy, etc. In the "external" subdirectory, you can try:

# startproj.sh script_path=`dirname $0` export PYTHONPATH=${script_path}/external;${PYTHONPATH} exec ${script_path}/projstartup.py 
+2
source

You can try freeze.py , see http://wiki.python.org/moin/Freeze for more details.

+4
source

Try py2exe .

+3
source

But if you make deb with the correct dependencies listed, the installer will download them for the user. This is the best way, since it is not redundant.

Maybe you can make tar or zip with your deb and all third-party deb and install scripts that just install all deb in the correct order. Thus, if the user already has the package, it will not be installed again.

+2
source

All Articles