Registry / devops / nuitka

nuitka

JSON →
library4.2pypypi✓ verified 23d ago

Nuitka is a Python compiler that transforms Python scripts and modules into optimized C code, which is then compiled into standalone executables or extension modules. It aims to improve execution performance, offer better source code obfuscation, and simplify application distribution by bundling all dependencies. Compatible with CPython versions 2.6, 2.7, and 3.4-3.13, it supports Windows, macOS, and Linux. The current stable version is 4.0.8, with an active development cadence including frequent updates and new major releases.

pip install Nuitka
INSTALL
IMPORT
SIG · NUITKA
N
nuitka
devopspythonv4.2
Install
6.8s avg
Import
Disk
47MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 47.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 6.8s · import 0.000s · 48MB
47MB installed
● package 47MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Nuitka via command line
python -m nuitka your_script.py
Nuitka is primarily a command-line tool. Using 'python -m nuitka' ensures it runs with the intended Python interpreter.

Create a file named `hello.py` with the content above, then compile it into a standalone executable. Run the executable from the `hello.dist` directory.

print('Hello, Nuitka!')
nuitka --version
Debug
Known issues
gotchaNuitka requires a compatible C compiler to be installed and correctly configured on your system (e.g., Visual Studio/MinGW-w64 on Windows, GCC/Clang on Linux/macOS). Missing or misconfigured compilers are a common initial setup hurdle.
fix
Ensure a supported C compiler is installed and accessible in your system's PATH. Nuitka may offer to download one on Windows. For detailed setup, consult the Nuitka documentation.
affects: All versions
gotchaWhen compiling in `--standalone` or `--onefile` mode, Nuitka might not automatically detect all data files (e.g., configuration files, images, model files) used by your application. This can lead to `FileNotFoundError` at runtime.
fix
Manually include necessary data files or directories using `--include-data-files=<source_path>=<destination_path>` or `--include-data-dir=<source_dir>=<destination_dir>` options during compilation.
affects: All versions
gotchaThe `--onefile` option, while convenient, can be more complex to debug for missing files and may result in slower startup times due to the unpacking process. `--standalone` (which creates a distribution folder) is generally recommended for initial testing and debugging.
fix
Start with `--standalone` to ensure your application works correctly, then switch to `--onefile` once all dependencies and data files are correctly handled and you are comfortable with the trade-offs.
affects: All versions
gotchaAlways invoke Nuitka using `python -m nuitka` instead of just `nuitka`. This ensures Nuitka runs with the specific Python interpreter you intend, preventing issues like `SyntaxError` or `ImportError` if multiple Python versions are present on your system.
fix
Replace `nuitka your_script.py` with `python -m nuitka your_script.py` in your build commands.
affects: All versions
gotchaNuitka can compile Python modules into CPython extension modules, but these cannot be directly executed using `python -m <compiled_module_name>`. Python's `-m` flag expects source code or a specific module structure that compiled extensions do not provide.
fix
Import the compiled extension module into another Python script and call its functions (e.g., `import compiled_module; compiled_module.main()`) or wrap it with a small executable script.
affects: All versions
gotchaCompiled Nuitka programs are designed to be stable, but segfaults or unexpected crashes can sometimes occur due to Nuitka bugs, unusual runtime conditions, or issues within third-party C/C++ extension modules.
fix
If a compiled program crashes, recompile it with the `--debug` flag. This adds runtime checks and often transforms a segfault into a more informative assertion error, aiding in diagnosis. Additionally, check for missing data files or implicit imports.
affects: All versions
Upgrade
Version history
4.2latest on PyPI · released Aug 27, 2026
Audit
Dependencies
C CompilerrequiredNuitka translates Python to C code, which then requires a C compiler (e.g., MSVC/MinGW-w64 on Windows, GCC/Clang on Linux/macOS) to produce machine code.
ccacheoptionalHighly recommended for significantly faster repeated compilations of generated C code.
Python 2 or 3.5+optionalFor Nuitka running on Python 3.4, an additional Python 2 or Python 3.5+ installation is required at compile time due to internal Scons tool compatibility issues.
zstandardoptionalRequired for compression when using the --onefile option. Not installed by default with Nuitka 4.0+.
Agent activity
7 hits · last 30 days
node
6
Resources
nuitka — pip install nuitka · libregistry