python-poetry/poetry · error · PoetryRuntimeError

One or more installed version do not work on your system. Th

Error message

One or more installed version do not work on your system. This is not a Poetry issue.

What it means

Raised as PoetryRuntimeError in PythonInstaller.exists when one or more previously-installed Poetry-managed Python executables raise CalledProcessError while being probed. Poetry treats this as a broken local install (not a Poetry bug) and lists the failing executables plus guidance to remove them.

Source

Thrown at src/poetry/utils/env/python/installer.py:85

    def exists(self) -> bool:
        version = self.version
        bad_executables = set()

        for python in Python.find_poetry_managed_pythons():
            try:
                if python.implementation.lower() != self.implementation:
                    continue
                if python.free_threaded != self.free_threaded:
                    continue

                if version == python.version:
                    return True
            except CalledProcessError:
                bad_executables.add(python.executable)

        if bad_executables:
            raise PoetryRuntimeError(
                reason="One or more installed version do not work on your system. This is not a Poetry issue.",
                messages=[
                    ConsoleMessage("\n".join(e.as_posix() for e in bad_executables))
                    .indent("  - ")
                    .make_section("Failing Executables")
                    .wrap("info"),
                    *[
                        ConsoleMessage(m).wrap("warning")
                        for m in BAD_PYTHON_INSTALL_INFO
                    ],
                ],
            )

        return False

    def install(self) -> None:
        try:
            # this can be broken into download, and install_file if required to make

View on GitHub (pinned to 92b74dcfe3)

Solutions

  1. Follow the message: 'poetry python remove <version>' for each failing executable listed.
  2. Install the platform runtime requirements python-build-standalone needs (see the docs URL in BAD_PYTHON_INSTALL_INFO).
  3. Reinstall the version after removing: 'poetry python install <version>'.
  4. If the OS is too old (e.g. ancient glibc), use a container/newer base image or a system interpreter instead.

Example fix

// before - installed 3.12 broken on this host
PythonInstaller(request="3.12").exists()  # -> PoetryRuntimeError

// after - remove and reinstall, or fix host libs
# poetry python remove 3.12 && poetry python install 3.12
Defensive patterns

Strategy: validation

Validate before calling

import subprocess
from pathlib import Path

def installed_pythons_run(installation_dir: Path) -> list[Path]:
    bad = []
    for exe in installation_dir.glob("**/bin/python*"):
        try:
            subprocess.check_output([str(exe), "--version"], text=True)
        except (subprocess.CalledProcessError, OSError):
            bad.append(exe)
    return bad

# before installer.exists():
assert not installed_pythons_run(installer.installation_directory), "remove broken installs first"

Type guard

from poetry.console.exceptions import PoetryRuntimeError, PoetryConsoleError

def is_poetry_runtime_error(e: Exception) -> bool:
    return isinstance(e, PoetryRuntimeError) or (
        isinstance(e, PoetryConsoleError) and "do not work on your system" in str(e)
    )

Try / catch

from poetry.console.exceptions import PoetryRuntimeError

try:
    installer.exists()
except PoetryRuntimeError as e:
    # message lists failing executables - remove them, then retry
    for ver in parse_failing_versions(e):
        run_cli(["poetry", "python", "remove", ver])
    installer.exists()

Prevention

When it happens

Trigger: Calling PythonInstaller(...).exists() (during version checks or 'poetry python list') where an installed standalone python under the installation_directory fails to run - typically missing OS-level shared libraries. Collects bad executables at installer.py:68-97 and raises if any found.

Common situations: A standalone build was installed but the host lacks runtime deps (glibc too old, missing libffi/libssl/libz); the install got interrupted leaving a half-extracted binary; an OS upgrade broke ABI compatibility of an older standalone build.

Related errors


AI-assisted analysis of python-poetry/poetry@92b74dcfe3 (2026-08-04). Data as JSON: /data/errors/74b7676853097f97.json. Report an issue: GitHub.