I have written an (obviously) excellent tool in python (under linux) that I would like to share with my co-workers. We work on different machines, but with the same, shared environment. Also, we are users, so there is no way of easily installing dependencies.
Now here's the catch: I like python, my users don't care. They do have access to company-wide installation of python (a simple one), but they don't want to care (well, that's understandable, not everyone is a programmer).
The question is: In such shared environment, where python interpreter is available, but the modules to my application are not, what could be the simplest way of sharing my tool with other users?
As you may imagine, my users don't want to install anything (especially in the user-space), configuring path would be probably on the edge of acceptance. The solution should not package EVERYTHING like a freeze, that's probably an overkill...
For the user it should be: copying a certain tar.gz or going to the app folder (shared), running the app, done.
So maybe the modules should somehow be embedded in the app? Or should I host (in my shared home) the modules in a library and setup some paths? Or maybe a virtualenv could help, if the users could copy the whole env with the path?
I hope you see my problem :D
Thanks!
The most convenient way to deliver a Python application to a user is to provide them with an executable—either a single file or a directory with an easily identified executable somewhere in it.
For "the same, shared environment" you could do:
Install your-script
to /your/shared/home/virtualenv
$ pip install your-app.tar.gz -E /your/shared/home/virtualenv
Make a link:
$ ln -s /your/shared/home/virtualenv/bin/your-script /shared/app/folder/
Your co-workers can invoke the script as /shared/app/folder/your-script
or add /shared/app/folder/
to PATH
.
/your/shared/home/virtualenv-old-version/bin/your-script
pip install -e .
; it makes available the version from your working directoryIn general it is not a preferable option to install Python apps.
Assuming your standard installs are Python 2.6 or later and you don't use any C extension modules, you can just throw it all in a zipfile, include a __main__.py
file and then prepend a shell header to the zipfile. Your scenario is precisely why this feature was added.
See http://bugs.python.org/issue1739468 for more details on how to set that up.
you can use pyinstaller to create a stand-alone executables
see:http://www.pyinstaller.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With