Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python to EXE file in one file

Tags:

python

exe

So far I have used cx_freeze to convert .py file to .exe file, but I get many files. Is there a way to get it all into one executable?

I have seen that PyInstallerGUI is able to that, but it is for Python 2.7. Can it be done with Python 3.4 as well?

like image 391
Orion1125 Avatar asked Dec 19 '22 15:12

Orion1125


1 Answers

PyInstaller works up to Python 3.5. Once you've installed it (type in your terminal pip install pyinstaller), you can do in your terminal:

pyinstaller --onefile script.py

where script.py is the name of script you want to compile into .exe

With the --onefile option it will create only one .exe file.

like image 101
Mikhail T. Avatar answered Dec 21 '22 11:12

Mikhail T.