Pyinstaller Basics: Convert .py to .exe/ELF
Pyinstaller can bundle Python .py files into Windows .exe or Linux ELF files. This video/post will cover the basics of using this useful tool.
Tutorial Info
Links
Note: I can not be responsible for the content of any of these external sites.
If any of these links are broken, please let me know!
Item | URL |
---|---|
Pyinstaller Website | https://www.pyinstaller.org/ |
Pyinstaller Documentation | https://pyinstaller.readthedocs.io/ |
C++ Redist (Windows only) | https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads |
Notes
I have only covered the basics in this video - there is much more to Pyinstaller! Please see the documentation linked above to learn more.
For Linux only:
- Build different versions for 32 and 64 bit applications
- Build on the oldest version of Linux you want to support
Music
“Thief in the Night”
Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0 License
Troubleshooting
Q: When I run the program on Windows, the console window opens… and then closes.
A: This could be caused by:
- Errors in your code - once your program runs into an error, it’ll close. Make sure that your program works fully before trying to package it with Pyinstaller.
- The lack of
input()
at the end of your program. Without it, your program will run and as soon as it’s finished, it’ll close.input()
will prevent the window from closing until you pressEnter
.