qbraid_core.services.projects.ProjectPythonMismatchError

exception qbraid_core.services.projects.ProjectPythonMismatchError(environments)

A required environment needs another Python, or platform, than this machine runs.

Raised by prepare_project before any clone, download, directory or receipt write when no usable python_choice was given for such an environment. Ask the person which option to use, then prepare again with python_choice set to one of options (for every environment) or to a {slug: option} mapping.

Options:

  • "install_python": get the environment’s Python from uv’s managed Pythons (uv python install) and install the reviewed archive against it. Offered only when uv is available and the platform matches.

  • "rebuild": create a fresh environment on this machine’s running Python and install the environment’s declared packages from the package index. Offered only when the environment declares a valid package list the person can be shown in full (see rebuildLimits in to_dict()); an environment past those limits has packagesOverLimit: true and a rebuild choice for it is refused with this error.

An empty options list is a plain refusal. Either way, retrying the same call can never succeed, so callers should not offer a retry: offer options instead (like ProjectSetupUnavailableError). A subclass of ProjectInstallError so existing handlers keep catching it.