Tutorial Setup and Build
This is basic steps if you have nothing installed, of course if you have any of the parts, just skip it. Download and install Python from https://www.python.org/downloads/windows Select one of Verify it’s working using command Verify using command make a python file named hello.py Do as you normally would. Running Nuitka on code that works incorrectly is not easier to debug. Note This will prompt you to download a C caching tool (to speed up repeated compilation of generated C code) and a MinGW64 based C compiler, unless you have a suitable MSVC installed. Say Execute the To distribute, build with You may also try NoteSetup
Install Python
Windows x86-64 web-based installer (64 bits Python, recommended) or x86 executable (32 bits Python) installer.python --version.Install Nuitka
python -m pip install Nuitkapython -m nuitka --versionWrite some code and test
Create a folder for the Python code
mkdir HelloWorlddef talk(message):
return "Talk " + message
def main():
print(talk("Hello World"))
if __name__ == "__main__":
main()
Test your program
python hello.py
Build it using
python -m nuitka hello.py
yes to both those questions.Run it
hello.exe created near hello.py.Distribute
--mode=standalone option, which will not output a single executable, but a whole folder. Copy the resulting hello.dist folder to the other machine and run it.--mode=onefile which creates a single executable file. However, we recommend first ensuring your program works correctly with --mode=standalone before using --mode=onefile, as any issues (such as missing data files) are easier to diagnose and fix in standalone mode.--mode=onefile automatically includes --mode=standalone behavior, so you do not need to pass both options together.