python nuitka build
@amitmund
August 17, 2026
# 1. Basic Compilation (Standalone Executable)
# Compiles the script and includes all necessary dependencies in a folder
python -m nuitka --standalone your_script.py
# 2. Single File Executable (OneFile)
# Bundles everything into a single executable file
python -m nuitka --standalone --onefile your_script.py
# 3. Include All Imports and Packages
# Automatically follows imports and includes specified packages
python -m nuitka --standalone --follow-imports --include-package=mypackage main.py
# 4. Include Data Files (Images, Configs, etc.)
# Bundles external data files required at runtime
python -m nuitka --standalone --include-data-file=./data/config.txt=config.txt main.py
python -m nuitka --standalone --include-data-dir=./assets=assets main.py
# 5. Enable Plugins (e.g., for NumPy, PySide2)
# Enables specific optimizations or support for third-party libraries
python -m nuitka --standalone --enable-plugin=numpy main.py
# 6. GitHub Actions CI/CD Workflow Example
# Uses the official Nuitka-Action for automated builds
- uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: your_main_program.py
mode: app # or 'standalone' or 'onefile'