How to convert Python program to Exe file?
Though there are different options to convert Python to Exe file, I prefer PyInstaller. It converts Python program to executable and also includes the additional libraries included in your program. So, in the target computer there is no need to install Python or required libraries. More over PyInstaller is available for Windows, Max & Linux. But it does not create a cross platform enabled executable file as mentioned in this official page. Note: It is assumed that you have the latest Python installed. This methods is tested & works fine in Windows 10 PC.Pyinstaller: Python to Exe steps
Package we are going to use to make Python exe is called PyInstaller. Follow these steps.- Open cmd & type: pip install pyinstaller
- Open folder that has the python program (.py file)
- Shift + Right click inside the folder.
- Choose: Open Powershell Window here
- Type ths command in powershell window:
- pyinstaller --onefile 'myPythonProgramName.py'
- Press 'Enter' key