How to convert python file to exe file?
![](https://pythonpoint.net/wp-content/uploads/2020/11/Purple-Skyscraper-City-Blog-Banner-7-1024x576.jpg)
Exe file is also known as executable file. So here we’ll see how to convert .py file to .exe file.
- Firstly we have to install pyinstaller.
- Go to command prompt.
- Run the following command.
- pip install pyinstaller.
![](https://pythonpoint.net/wp-content/uploads/2020/11/Screenshot-797-1024x551.png)
- Then we will go to the location where our python program is saved. Click shift and right click together .
![](https://pythonpoint.net/wp-content/uploads/2020/11/Screenshot-798-1024x539.png)
- We’ll see an open list like given below.
![](https://pythonpoint.net/wp-content/uploads/2020/11/Screenshot-799.png)
- Click open PowerShell windows here. And we’ll see a PowerShell windows .
![](https://pythonpoint.net/wp-content/uploads/2020/11/Screenshot-800-1024x103.png)
- Then write the command pyinstaller –onefile -w ‘filename.py’. Here our filename is hello.py.
pyinstaller --onefile -w 'filename.py'
![](https://pythonpoint.net/wp-content/uploads/2020/11/Screenshot-801-1024x550.png)
- Then go to dist folder and see the .exe file of same name.
![](https://pythonpoint.net/wp-content/uploads/2020/11/Screenshot-802-1024x151.png)
![](https://pythonpoint.net/wp-content/uploads/2020/11/Screenshot-803-1024x310.png)
This is how we can convert .py file into .exe file.
Subscribe
Login
Please login to comment
0 Discussion