DEV Community 👩‍💻👨‍💻

Hamza Hesham
Hamza Hesham

Posted on

How to convert .py file to .exe 2 methods

hello , today i will show you how to convert python file(.py) to an executable file(.exe) .

first method:

first , open your terminal or command line , write this command to install auto-py-to-exe

pip install auto-py-to-exe

second, after installing auto-py-to-exe write this command to open



after writing this command this window will open :
Alt Text
set the script location then convert.

second method:

we will use py installer
in the command line write:

pip install PyInstaller

After installing pyinstaller write the path of the file.

cd Desktop

after going to the path of the file:


after the build complete select file called dist:
Alt Text
then select name of the file.exe:
Alt Text

Note: auto-py-to-exe uses pyinstaller:

Alt Text
Don't forget to follow me .
you can support me on buy me a coffee:
Buy Me A Coffee
Twitter :
buy me a coffee :
thanks for reading .

Top comments (0)


Thank you.

Thanks for visiting DEV, we’ve worked really hard to cultivate this great community and would love to have you join us. If you’d like to create an account, you can sign up here.