.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.48.1.
.TH NUITKA "1" "February 2022" "nuitka 0.7" "User Commands"
.SH NAME
nuitka \- the Python compiler
.SH SYNOPSIS
.B nuitka
[\fI\,--module\/\fR] [\fI\,--run\/\fR] [\fI\,options\/\fR] \fI\,main_module.py\/\fR
.SH OPTIONS
.TP
\fB\-\-version\fR
show program's version number and exit
.TP
\fB\-h\fR, \fB\-\-help\fR
show this help message and exit
.TP
\fB\-\-module\fR
Create an extension module executable instead of a
program. Defaults to off.
.TP
\fB\-\-standalone\fR
Enable standalone mode for output. This allows you to
transfer the created binary to other machines without
it using an existing Python installation. This also
means it will become big. It implies these option: "\-\-
follow\-imports" and "\-\-python\-flag=no_site". Defaults
to off.
.TP
\fB\-\-onefile\fR
On top of standalone mode, enable onefile mode. This
means not a folder, but a compressed executable is
created and used. Defaults to off.
.TP
\fB\-\-python\-debug\fR
Use debug version or not. Default uses what you are
using to run Nuitka, most likely a non\-debug version.
.TP
\fB\-\-python\-flag\fR=\fI\,FLAG\/\fR
Python flags to use. Default is what you are using to
run Nuitka, this enforces a specific mode. These are
options that also exist to standard Python executable.
Currently supported: "\-S" (alias "no_site"),
"static_hashes" (do not use hash randomization),
"no_warnings" (do not give Python runtime warnings),
"\-O" (alias "no_asserts"), "no_docstrings" (do not use
docstrings), "\-u" (alias "unbuffered") and "\-m".
Default empty.
.TP
\fB\-\-python\-for\-scons\fR=\fI\,PATH\/\fR
If using Python3.3 or Python3.4, provide the path of a
Python binary to use for Scons. Otherwise Nuitka can
use what you run Nuitka with or a "scons" binary that
is found in PATH, or a Python installation from
Windows registry.
.TP
\fB\-\-warn\-implicit\-exceptions\fR
Enable warnings for implicit exceptions detected at
compile time.
.TP
\fB\-\-warn\-unusual\-code\fR
Enable warnings for unusual code detected at compile
time.
.TP
\fB\-\-assume\-yes\-for\-downloads\fR
Allow Nuitka to download external code if necessary,
e.g. dependency walker, ccache, and even gcc on
Windows. To disable, redirect input from nul device,
e.g. "</dev/null" or "<NUL:". Default is to prompt.
.IP
Control the inclusion of modules and packages in result.:
.TP
\fB\-\-include\-package\fR=\fI\,PACKAGE\/\fR
Include a whole package. Give as a Python namespace,
e.g. "some_package.sub_package" and Nuitka will then
find it and include it and all the modules found below
that disk location in the binary or extension module
it creates, and make it available for import by the
code. To avoid unwanted sub packages, e.g. tests you
can e.g. do this "\-\-nofollow\-import\-to=*.tests".
Default empty.
.TP
\fB\-\-include\-module\fR=\fI\,MODULE\/\fR
Include a single module. Give as a Python namespace,
e.g. "some_package.some_module" and Nuitka will then
find it and include it in the binary or extension
module it creates, and make it available for import by
the code. Default empty.
.TP
\fB\-\-include\-plugin\-directory\fR=\fI\,MODULE\/\fR/PACKAGE
Include the content of that directory, no matter if
it's used by the given main program in a visible form.
Overrides all other inclusion options. Can be given
multiple times. Default empty.
.TP
\fB\-\-include\-plugin\-files\fR=\fI\,PATTERN\/\fR
Include into files matching the PATTERN. Overrides all
other follow options. Can be given multiple times.
Default empty.
.TP
\fB\-\-prefer\-source\-code\fR
For already compiled extension modules, where there is
both a source file and an extension module, normally
the extension module is used, but it should be better
to compile the module from available source code for
best performance. If not desired, there is \fB\-\-noprefer\-source\-code\fR to disable warnings about it.
Default off.
.IP
Control the following into imported modules:
.TP
\fB\-\-follow\-stdlib\fR
Also descend into imported modules from standard
library. This will increase the compilation time by a
lot. Defaults to off.
.TP
\fB\-\-nofollow\-imports\fR
When \fB\-\-nofollow\-imports\fR is used, do not descend into
any imported modules at all, overrides all other
inclusion options. Defaults to off.
.TP
\fB\-\-follow\-imports\fR
When \fB\-\-follow\-imports\fR is used, attempt to descend into
all imported modules. Defaults to off.
.TP
\fB\-\-follow\-import\-to\fR=\fI\,MODULE\/\fR/PACKAGE
Follow to that module if used, or if a package, to the
whole package. Can be given multiple times. Default
empty.
.TP
\fB\-\-nofollow\-import\-to\fR=\fI\,MODULE\/\fR/PACKAGE
Do not follow to that module name even if used, or if
a package name, to the whole package in any case,
overrides all other options. Can be given multiple
times. Default empty.
.IP
Data files for standalone/onefile mode:
.TP
\fB\-\-include\-package\-data\fR=\fI\,PACKAGE\/\fR
Include data files of the given package name. Can use
patterns. By default Nuitka does not unless hard coded
and vital for operation of a package. This will
include all non\-DLL, non\-extension modules in the
distribution. Default empty.
.TP
\fB\-\-include\-data\-file\fR=\fI\,DESC\/\fR
Include data files by filenames in the distribution.
There are many allowed forms. With '\-\-include\-datafile=/path/to/file/*.txt=folder_name/some.txt' it will
copy a single file and complain if it's multiple. With
\&'\-\-include\-datafile=/path/to/files/*.txt=folder_name/' it will put
all matching files into that folder. For recursive
copy there is a form with 3 values that '\-\-includedata\-file=/path/to/scan=folder_name=**/*.txt' that
will preserve directory structure. Default empty.
.TP
\fB\-\-include\-data\-dir\fR=\fI\,DIRECTORY\/\fR
Include data files from complete directory in the
distribution. This is recursive. Check '\-\-includedata\-file' with patterns if you want non\-recursive
inclusion. An example would be '\-\-include\-datadir=/path/somedir=data/somedir' for plain copy, of the
whole directory. All files are copied, if you want to
exclude files you need to remove them beforehand.
Default empty.
.IP
Immediate execution after compilation:
.TP
\fB\-\-run\fR
Execute immediately the created binary (or import the
compiled module). Defaults to off.
.TP
\fB\-\-debugger\fR, \fB\-\-gdb\fR
Execute inside a debugger, e.g. "gdb" or "lldb" to
automatically get a stack trace. Defaults to off.
.TP
\fB\-\-execute\-with\-pythonpath\fR
When immediately executing the created binary
(\fB\-\-execute\fR), don't reset PYTHONPATH. When all modules
are successfully included, you ought to not need
PYTHONPATH anymore.
.IP
Dump options for internal tree:
.TP
\fB\-\-xml\fR
Dump the final result of optimization as XML, then
exit.
.IP
Code generation choices:
.TP
\fB\-\-disable\-bytecode\-cache\fR
Do not reuse dependency analysis results for modules,
esp. from standard library, that are included as
bytecode.
.TP
\fB\-\-full\-compat\fR
Enforce absolute compatibility with CPython. Do not
even allow minor deviations from CPython behavior,
e.g. not having better tracebacks or exception
messages which are not really incompatible, but only
different. This is intended for tests only and should
not be used for normal use.
.TP
\fB\-\-file\-reference\-choice\fR=\fI\,MODE\/\fR
Select what value "__file__" is going to be. With
"runtime" (default for standalone binary mode and
module mode), the created binaries and modules, use
the location of themselves to deduct the value of
"__file__". Included packages pretend to be in
directories below that location. This allows you to
include data files in deployments. If you merely seek
acceleration, it's better for you to use the
"original" value, where the source files location will
be used. With "frozen" a notation "<frozen
module_name>" is used. For compatibility reasons, the
"__file__" value will always have ".py" suffix
independent of what it really is.
.IP
Output choices:
.TP
\fB\-o\fR FILENAME
Specify how the executable should be named. For
extension modules there is no choice, also not for
standalone mode and using it will be an error. This
may include path information that needs to exist
though. Defaults to '<program_name>' on this platform.
\&.bin
.TP
\fB\-\-output\-dir\fR=\fI\,DIRECTORY\/\fR
Specify where intermediate and final output files
should be put. The DIRECTORY will be populated with C
files, object files, etc. Defaults to current
directory.
.TP
\fB\-\-remove\-output\fR
Removes the build directory after producing the module
or exe file. Defaults to off.
.TP
\fB\-\-no\-pyi\-file\fR
Do not create a ".pyi" file for extension modules
created by Nuitka. This is used to detect implicit
imports. Defaults to off.
.IP
Debug features:
.TP
\fB\-\-debug\fR
Executing all self checks possible to find errors in
Nuitka, do not use for production. Defaults to off.
.TP
\fB\-\-unstripped\fR
Keep debug info in the resulting object file for
better debugger interaction. Defaults to off.
.TP
\fB\-\-profile\fR
Enable vmprof based profiling of time spent. Not
working currently. Defaults to off.
.TP
\fB\-\-internal\-graph\fR
Create graph of optimization process internals, do not
use for whole programs, but only for small test cases.
Defaults to off.
.TP
\fB\-\-trace\-execution\fR
Traced execution output, output the line of code
before executing it. Defaults to off.
.TP
\fB\-\-recompile\-c\-only\fR
This is not incremental compilation, but for Nuitka
development only. Takes existing files and simply
compile them as C again. Allows compiling edited C
files for quick debugging changes to the generated
source, e.g. to see if code is passed by, values
output, etc, Defaults to off. Depends on compiling
Python source to determine which files it should look
at.
.TP
\fB\-\-generate\-c\-only\fR
Generate only C source code, and do not compile it to
binary or module. This is for debugging and code
coverage analysis that doesn't waste CPU. Defaults to
off. Do not think you can use this directly.
.TP
\fB\-\-experimental\fR=\fI\,FLAG\/\fR
Use features declared as 'experimental'. May have no
effect if no experimental features are present in the
code. Uses secret tags (check source) per experimented
feature.
.TP
\fB\-\-low\-memory\fR
Attempt to use less memory, by forking less C
compilation jobs and using options that use less
memory. For use on embedded machines. Use this in case
of out of memory problems. Defaults to off.
.IP
Backend C compiler choice:
.TP
\fB\-\-clang\fR
Enforce the use of clang. On Windows this requires a
working Visual Studio version to piggy back on.
Defaults to off.
.TP
\fB\-\-mingw64\fR
Enforce the use of MinGW64 on Windows. Defaults to
off.
.TP
\fB\-\-msvc\fR=\fI\,MSVC_VERSION\/\fR
Enforce the use of specific MSVC version on Windows.
Allowed values are e.g. "14.3" (MSVC 2022) and other
MSVC version numbers, specify "list" for a list of
installed compilers, or use "latest".  Defaults to
latest MSVC being used if installed, otherwise MinGW64
is used.
.TP
\fB\-j\fR N, \fB\-\-jobs\fR=\fI\,N\/\fR
Specify the allowed number of parallel C compiler
jobs. Defaults to the system CPU count.
.TP
\fB\-\-lto\fR=\fI\,choice\/\fR
Use link time optimizations (MSVC, gcc, clang).
Allowed values are "yes", "no", and "auto" (when it's
known to work). Defaults to "auto".
.TP
\fB\-\-static\-libpython\fR=\fI\,choice\/\fR
Use static link library of Python. Allowed values are
"yes", "no", and "auto" (when it's known to work).
Defaults to "auto".
.TP
\fB\-\-disable\-ccache\fR
Do not attempt to use ccache (gcc, clang, etc.) or
clcache (MSVC, clangcl).
.IP
PGO compilation choices:
.TP
\fB\-\-pgo\fR
Enables C level profile guided optimization (PGO), by
executing a dedicated build first for a profiling run,
and then using the result to feedback into the C
compilation. Note: This is experimental and not
working with standalone modes of Nuitka yet. Defaults
to off.
.TP
\fB\-\-pgo\-args\fR=\fI\,PGO_ARGS\/\fR
Arguments to be passed in case of profile guided
optimization. These are passed to the special built
executable during the PGO profiling run. Default
empty.
.TP
\fB\-\-pgo\-executable\fR=\fI\,PGO_EXECUTABLE\/\fR
Command to execute when collecting profile
information. Use this only, if you need to launch it
through a script that prepares it to run. Default use
created program.
.IP
Tracing features:
.TP
\fB\-\-quiet\fR
Disable all information outputs, but show warnings.
Defaults to off.
.TP
\fB\-\-show\-scons\fR
Operate Scons in non\-quiet mode, showing the executed
commands. Defaults to off.
.TP
\fB\-\-show\-progress\fR
Provide progress information and statistics. Defaults
to off.
.TP
\fB\-\-no\-progressbar\fR
Disable progress bar outputs (if tqdm is installed).
Defaults to off.
.TP
\fB\-\-show\-memory\fR
Provide memory information and statistics. Defaults to
off.
.TP
\fB\-\-show\-modules\fR
Provide information for included modules and DLLs
Defaults to off.
.TP
\fB\-\-show\-modules\-output\fR=\fI\,PATH\/\fR
Where to output \fB\-\-show\-modules\fR, should be a filename.
Default is standard output.
.TP
\fB\-\-report\fR=\fI\,COMPILATION_REPORT_FILENAME\/\fR
Report module inclusion in an XML output file. Default
is off.
.TP
\fB\-\-verbose\fR
Output details of actions taken, esp. in
optimizations. Can become a lot. Defaults to off.
.TP
\fB\-\-verbose\-output\fR=\fI\,PATH\/\fR
Where to output \fB\-\-verbose\fR, should be a filename.
Default is standard output.
.IP
Windows specific controls:
.TP
\fB\-\-windows\-disable\-console\fR
When compiling for Windows, disable the console
window. Defaults to off.
.TP
\fB\-\-windows\-icon\-from\-ico\fR=\fI\,ICON_PATH\/\fR
Add executable icon. Can be given multiple times for
different resolutions or files with multiple icons
inside. In the later case, you may also suffix with
#<n> where n is an integer index starting from 1,
specifying a specific icon to be included, and all
others to be ignored.
.TP
\fB\-\-windows\-icon\-from\-exe\fR=\fI\,ICON_EXE_PATH\/\fR
Copy executable icons from this existing executable
(Windows only).
.TP
\fB\-\-onefile\-windows\-splash\-screen\-image\fR=\fI\,SPLASH_SCREEN_IMAGE\/\fR
When compiling for Windows and onefile, show this
while loading the application. Defaults to off.
.TP
\fB\-\-windows\-uac\-admin\fR
Request Windows User Control, to grant admin rights on
execution. (Windows only). Defaults to off.
.TP
\fB\-\-windows\-uac\-uiaccess\fR
Request Windows User Control, to enforce running from
a few folders only, remote desktop access. (Windows
only). Defaults to off.
.TP
\fB\-\-windows\-company\-name\fR=\fI\,WINDOWS_COMPANY_NAME\/\fR
Name of the company to use in Windows Version
information.  One of file or product version is
required, when a version resource needs to be added,
e.g. to specify product name, or company name.
Defaults to unused.
.TP
\fB\-\-windows\-product\-name\fR=\fI\,WINDOWS_PRODUCT_NAME\/\fR
Name of the product to use in Windows Version
information. Defaults to base filename of the binary.
.TP
\fB\-\-windows\-file\-version\fR=\fI\,WINDOWS_FILE_VERSION\/\fR
File version to use in Windows Version information.
Must be a sequence of up to 4 numbers, e.g. 1.0.0.0,
only this format is allowed. One of file or product
version is required, when a version resource needs to
be added, e.g. to specify product name, or company
name. Defaults to unused.
.TP
\fB\-\-windows\-product\-version\fR=\fI\,WINDOWS_PRODUCT_VERSION\/\fR
Product version to use in Windows Version information.
Must be a sequence of up to 4 numbers, e.g. 1.0.0.0,
only this format is allowed. One of file or product
version is required, when a version resource needs to
be added, e.g. to specify product name, or company
name. Defaults to unused.
.TP
\fB\-\-windows\-file\-description\fR=\fI\,WINDOWS_FILE_DESCRIPTION\/\fR
Description of the file use in Windows Version
information.  One of file or product version is
required, when a version resource needs to be added,
e.g. to specify product name, or company name.
Defaults to nonsense.
.TP
\fB\-\-windows\-onefile\-tempdir\-spec\fR=\fI\,ONEFILE_TEMPDIR_SPEC\/\fR, \fB\-\-onefile\-tempdir\-spec\fR=\fI\,ONEFILE_TEMPDIR_SPEC\/\fR
Use this as a temporary folder. Defaults to
\&'%TEMP%\eonefile_%PID%_%TIME%', i.e. system temporary
directory.
.TP
\fB\-\-windows\-force\-stdout\-spec\fR=\fI\,WINDOWS_FORCE_STDOUT_SPEC\/\fR
Force standard output of the program to go to this
location. Useful for programs with disabled console
and programs using the Windows Services Plugin of
Nuitka. Defaults to not active, use e.g.
\&'%PROGRAM%.out.txt', i.e. file near your program.
.TP
\fB\-\-windows\-force\-stderr\-spec\fR=\fI\,WINDOWS_FORCE_STDERR_SPEC\/\fR
Force standard error of the program to go to this
location. Useful for programs with disabled console
and programs using the Windows Services Plugin of
Nuitka. Defaults to not active, use e.g.
\&'%PROGRAM%.err.txt', i.e. file near your program.
.IP
macOS specific controls:
.TP
\fB\-\-macos\-target\-arch\fR=\fI\,MACOS_TARGET_ARCH\/\fR
What architectures is this to supposed to run on.
Default and limit is what the running Python allows
for. Default is "native" which is the architecture the
Python is run with.
.TP
\fB\-\-macos\-disable\-console\fR
When compiling for macOS, disable the console window
and create a GUI application. Defaults to off.
.TP
\fB\-\-macos\-create\-app\-bundle\fR
When compiling for macOS, create a bundle rather than
a plain binary application. Currently experimental and
incomplete. Currently this is the only way to unlock
disabling of console.Defaults to off.
.TP
\fB\-\-macos\-onefile\-icon\fR=\fI\,ICON_PATH\/\fR
Add executable icon for binary to use. Can be given
only one time. Defaults to Python icon if available.
.TP
\fB\-\-macos\-signed\-app\-name\fR=\fI\,MACOS_SIGNED_APP_NAME\/\fR
Name of the application to use for macOS signing.
Follow com.yourcompany.appname naming results for best
results, as these have to be globally unique, and will
grant protected API accesses.
.TP
\fB\-\-macos\-app\-name\fR=\fI\,MACOS_APP_NAME\/\fR
Name of the product to use in macOS bundle
information. Defaults to base filename of the binary.
.TP
\fB\-\-macos\-app\-version\fR=\fI\,MACOS_APP_VERSION\/\fR
Product version to use in macOS bundle information.
Defaults to 1.0 if not given.
.IP
Linux specific controls:
.TP
\fB\-\-linux\-onefile\-icon\fR=\fI\,ICON_PATH\/\fR
Add executable icon for onefile binary to use. Can be
given only one time. Defaults to Python icon if
available.
.TP
\fB\-\-linux\-onefile\-compression\fR=\fI\,COMPRESSION\/\fR
Compression method to use for Linux onefile builds.
Defaults to gzip for faster decompression
.IP
Plugin control:
.TP
\fB\-\-enable\-plugin\fR=\fI\,PLUGIN_NAME\/\fR, \fB\-\-plugin\-enable\fR=\fI\,PLUGIN_NAME\/\fR
Enabled plugins. Must be plug\-in names. Use \fB\-\-pluginlist\fR to query the full list and exit. Default empty.
.TP
\fB\-\-disable\-plugin\fR=\fI\,PLUGIN_NAME\/\fR, \fB\-\-plugin\-disable\fR=\fI\,PLUGIN_NAME\/\fR
Disabled plugins. Must be plug\-in names. Use \fB\-\-pluginlist\fR to query the full list and exit. Default empty.
.TP
\fB\-\-plugin\-no\-detection\fR
Plugins can detect if they might be used, and the you
can disable the warning via "\-\-disable\-plugin=pluginthat\-warned", or you can use this option to disable
the mechanism entirely, which also speeds up
compilation slightly of course as this detection code
is run in vain once you are certain of which plugins
to use. Defaults to off.
.TP
\fB\-\-plugin\-list\fR
Show list of all available plugins and exit. Defaults
to off.
.TP
\fB\-\-user\-plugin\fR=\fI\,PATH\/\fR
The file name of user plugin. Can be given multiple
times. Default empty.
.TP
\fB\-\-persist\-source\-changes\fR
Write source changes to original Python files. Use
with care. May need permissions, best for use in a
virtualenv to debug if plugin code changes work with
standard Python or to benefit from bloat removal even
with pure Python. Default False.
.IP
Plugin anti\-bloat:
.TP
\fB\-\-noinclude\-setuptools\-mode\fR=\fI\,NOINCLUDE_SETUPTOOLS_MODE\/\fR
What to do if a setuptools import is encountered. This
package can be big with dependencies, and should
definitely be avoided.
.TP
\fB\-\-noinclude\-pytest\-mode\fR=\fI\,NOINCLUDE_PYTEST_MODE\/\fR
What to do if a pytest import is encountered. This
package can be big with dependencies, and should
definitely be avoided.
.TP
\fB\-\-noinclude\-IPython\-mode\fR=\fI\,NOINCLUDE_IPYTHON_MODE\/\fR
What to do if a IPython import is encountered. This
package can be big with dependencies, and should
definitely be avoided.
.TP
\fB\-\-noinclude\-default\-mode\fR=\fI\,NOINCLUDE_DEFAULT_MODE\/\fR
This actually provides the default "warning" value for
above options, and can be used to turn all of these
on.
.TP
\fB\-\-noinclude\-custom\-mode\fR=\fI\,CUSTOM_CHOICES\/\fR
What to do if a specific import is encountered. Format
is module name, which can and should be a top level
package and then one choice, "error", "warning",
"nofollow", e.g. PyQt5:error.
.PP
Commercial: None
Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
Flavor: Debian Python
Executable: \fI\,/usr/bin/python3\/\fP
OS: Linux
Arch: x86_64
Distribution: Debian (based on None) 11
.SH EXAMPLES

Compile a Python file "some_module.py" to a module "some_module.so":
.IP
\f(CW$ nuitka \-\-module some_module.py\fR
.PP
Compile a Python program "some_program.py" to an executable "some_program.exe":
.IP
\f(CW$ nuitka some_program.py\fR
.PP
Compile a Python program "some_program.py" and the package "some_package" it
uses to an executable "some_program.exe":
.IP
\f(CW$ nuitka \-\-recurse\-to=some_package some_program.py\fR
.PP
Compile a Python program "some_program.py" and all the modules it uses to an executable "some_program.exe". Then execute it immediately when ready:
.IP
\f(CW$ nuitka \-\-run \-\-recurse\-all some_program.py\fR
.PP
Compile a Python program "some_program.py" and the modules it uses (even standard library) to an executable "some_program.exe":
.IP
\f(CW$ nuitka \-\-recurse\-all \-\-recurse\-stdlib some_program.py\fR
.PP
Compile a Python program "some_program.py" and the modules it uses to an executable "some_program.exe". Keep the debug information, so valgrind, gdb, etc. work
nicely.

Note: This will *not* degrade performance:
.IP
\f(CW$ nuitka \-\-unstripped \-\-recurse\-all some_program.py\fR
.PP
Compile a Python program "some_program.py" and the modules it uses to an executable "some_program.exe". Perform all kinds of checks about correctness of the generated
C and run\-time checks.

Note: This will degrade performance and should only be used to debug Nuitka:
.IP
\f(CW$ nuitka \-\-debug \-\-recurse\-all some_program.py\fR
.PP
Compile a Python program "some_program.py" and the modules it uses to an executable "some_program.exe". Perform all kinds of checks about correctness of the generated
C and run\-time checks. Also use the debug Python library, which does its own checks.

Note: This will degrade performance and should only be used to debug Nuitka:
.IP
\f(CW$ nuitka \-\-debug \-\-python-debug \-\-recurse\-all some_program.py\fR
.PP
Compile a Python program "some_program.py" and the plugins modules it loads at run time to an executable "some_program.exe":
.IP
\f(CW$ nuitka \-\-recurse\-all \-\-recurse\-directory=plugins_dir some_program.py\fR
.PP
