Commercial Users
Release Information
More documentation
Media
Other
Under construction
Looking to create an executable from Python script? Let me show you the full steps to achieve it on Windows .
The simple way to add Python to the PATH do this is to check the box during installation of CPython. You just download python and install or modify Python by checking the box in the installer:
PATH
This box is not enabled by default. You can also manually add the Python installation path to PATH environment variable.
Note
You do not strictly have to execute this step, you can also replace python with just the absolute path, e.g. C:\Users\YourName\AppData\Local\Programs\Python\Python310\python.exe but that can become inconvenient.
python
C:\Users\YourName\AppData\Local\Programs\Python\Python310\python.exe
This can be cmd.exe or Windows Terminal, or from an IDE like Visual Code or PyCharm. And then type python to verify the correct installation, and exit to leave the Python prompt again.
cmd.exe
exit
Now install Nuitka with the following command.
python -m pip install nuitka
Now run your program from the terminal. Convince yourself that everything is working.
python fancy-program.py
If it’s a GUI program, make sure it has a .pyw suffix. That is going to make Python know it’s one.
.pyw
python -m nuitka --onefile fancy-program.py
In case of a terminal program, add one of many options that Nuitka has to adapt for platform specifics, e.g. program icon, and so on.
python -m nuitka --onefile --windows-disable-console fancy-program.py
This will create fancy-program.exe .
fancy-program.exe
Your executable should appear right near fancy-program.py and opening the explorer or running fancy-program.exe from the Terminal should be good.
fancy-program.py