-1

Say I made Python script with a GUI, which depends on a few libraries (e.g. Pandas). I want to share this application with users who know nothing about programming, and who are used to simply click an install file or open an executable.

What are the options for bundling my script, its dependencies, and the Python runtime together so that my users can "just" use it ? This can be either as an executable, or an online app.

EDIT : some users pointed to this page as a duplicate. This obviously true, but most answers are pretty old. I'm looking for up-to-date solutions as of 2019.

gnat
  • 6,213
  • 108
  • 53
  • 73
GuitarExtended
  • 787
  • 2
  • 11
  • 32
  • 1
    https://www.pyinstaller.org/ – AKX Feb 20 '19 at 13:01
  • 3
    Possible duplicate of [Distributing Python programs](https://stackoverflow.com/questions/1950218/distributing-python-programs) – John Coleman Feb 20 '19 at 13:04
  • If the duplicate question has answers that are old, the right thing to do is to try to get updated answers there, or to merge the answers from the two questions together. If you feel like there aren't enough answers for an existing question, you can offer a bounty on that question. – Daniel Pryden Feb 20 '19 at 13:22
  • Also, as a general response to this kind of question: it's very common for someone to just write a script and then try to figure out how to give it to other people. But "productionizing" software is a whole art and science in itself. In The Mythical Man-Month, Brooks estimates that creating a packaged software product is at least three times as much work as creating the software in the first place. Things have gotten simpler since that time, but still there are many choices and problems to solve. A big enough product will need a dedicated release engineering role for this sort of thing. – Daniel Pryden Feb 20 '19 at 13:26
  • Does this answer your question? [How to deploy python script?](https://stackoverflow.com/questions/52187362/how-to-deploy-python-script) – halt9k Jan 01 '23 at 15:46

2 Answers2

2

I have been using PyInstaller for a while now, seems like it would do exactly what you want.

pkiller162
  • 352
  • 1
  • 11
  • 1
    Perhaps you can add this answer to the duplicate question (see above). That way when this question closes (as it is likely to do), the other question will have a more up-to-date answer. – John Coleman Feb 20 '19 at 13:17
  • Me ? or the use who posted this answer ? – GuitarExtended Feb 20 '19 at 13:43
  • @GuitarExtended I was thinking of the person who posted the answer, but if they don't do it, there is no reason that you couldn't. The only reason I didn't do it myself is that I didn't want to take credit from low-rep users. – John Coleman Feb 20 '19 at 13:52
  • I will do this :) – pkiller162 Feb 20 '19 at 13:53
1

You need to use pyinstaller package

PyInstaller freezes (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX.

pyinstaller.org

Mohammad Jafari
  • 1,742
  • 13
  • 17