You can sign up to get a daily email of our articles, see the Mailing List page!
Distributing a python program?
Guppy commented on 24 May 2019 at 8:01 am UTC

Out of boredom I've decided to give python another go, but I'm facing an issue with distributing what I'm making;

Say you've written a python program and you want so share it with non tech savvy people, what is the best practice?

currently I'm looking a "install python3 install pip, the do a whole bunch of pip commands to install dependencies and then just click the script file"

For C/C++ I'd just statically link any non standard dependencies and give them a single executable - it might be a bother to setup cross compilation, etc but once it's done you have a single file/archive you just give them and that requires minimal effort for the intended end user - is there something like this for python?

I realize they will most likely need to install a python interpreter for their specific OS, but it would be nice if there was some sort of "pull these dependencies if they are not available" manifest you could include so it would atleast do that part automatically

Corben commented on 24 May 2019 at 9:41 am UTC

Give PyInstaller a go. It can compile your script with all dependencies into a binary which you can share then.

If you want to share the script itself, it's common practice to give a requirements.txt file with it, where the user just has to run e.g.: python -m pip install -r requirements.txt
That would install all needed dependencies that are specified in that requirements file.

You need to Register and Login to comment, submit articles and more.

Or login with...

Livestreams & Videos
None currently, submit yours here!
See more!
Popular this week
View by Category
Latest Comments
Latest Forum Posts