Convert Python Script to Executable(.exe) file.
We create many Python programs daily and also wish to share some with our colleagues or the World. But its obvious that everyone does not have Python installed in their system. So to avoid this problem we need an Executable file which runs without any prerequisite. So we will have to convert .py file to .exe file.
Step1:
Install the library pyinstaller.
Type below command in the command prompt.
pip install pyinstaller
Step2:
Go to the directory where you saved your Python Script.
Convert .py to .exe |
Step3:
Press Shift button and Right click on mouse simultaneously. Click on "Open Command Window here".
Convert .py to .exe |
Step5:
Type the command in the in the Command Prompt.
pyinstaller --onefile -w 'filename.py'
Here our file name is 'tutorial.py'
See below:
After typing the command ‘Hit the Enter’.
It will take some time to finish the process depending on the size of the file and how big is your project.After the processing has been finished, the window will look as below:
Leave all your errors & problems here! Gonna solve it together
ReplyDeletePip not found error how to resolve?
DeletePlz reply that's urgent!
DeleteAdd your Python bin file in Enviornment variables and restart your pc. It must resolve. If not then tell me in the replies
DeleteSuch a helpful post
ReplyDeleteThanks for your Comment!
Delete