Shaved Man
Shaved Man

Reputation: 57

How to make an installer for a python program

Is it possible to have someone not have python installed, double click on my installer and through that get an executable, the python, and the needed libraries?

For that I would probably also want to know, if I can type anything but python path/file.py to run the python script. Because for that you would need to add the python installation to path. And is there a way to bypass this? To type something else instead of python like manually type the location where the executable is or so?

My boss asked me this today. Don’t think that’s a common task to do with python but if I know how to do that with python, I for one can do it with python and I will also easier understand how one normally writes installers and programs with guis and such. I do like python though.

I guess this is not an easy question. I really am interested though. If you can only answer the second question, I would also be very grateful because then i can figure out the rest I think.

Upvotes: 0

Views: 912

Answers (1)

ph140
ph140

Reputation: 475

You can use pyinstaller to create an executable. pip install pyinstaller in cmd.

Then cd into the directory where your file is, and type pyinstaller --onefile filename.py

Upvotes: 1

Related Questions