qgis_deployment_toolbelt.utils.frozen_app module

Helper to determine whether the current Python interpreter is running as frozen/bundled application (i.e. PyInstaller, cx_Freeze…) or not.

A “frozen” application is a Python program bundled into a standalone executable using tools such as PyInstaller or cx_Freeze. These tools typically set the sys.frozen attribute at runtime.

See: https://pyinstaller.org/en/latest/runtime-information.html#run-time-information

qgis_deployment_toolbelt.utils.frozen_app.is_frozen_app(log: bool = True) bool

Determine whether the current Python process is running as a frozen application.

Parameters:

log (bool, optional) – option to log result. Defaults to True.

Returns:

True if the interpreter is running in a frozen context, False otherwise.

Return type:

bool

qgis_deployment_toolbelt.utils.frozen_app.is_running_pyinstaller(log: bool = True) bool

Determine whether the current process is running from a PyInstaller bundle.

PyInstaller sets both:
  • sys.frozen (like other freezing tools)

  • sys._MEIPASS (temporary extraction directory or bundle path)

Parameters:

log (bool, optional) – option to log result. Defaults to True.

Returns:

True if executed from a PyInstaller-built executable, False otherwise.

Return type:

bool