{"id":"9e0d83d99abdccdf","repo":"pypa/pip","slug":"this-version-of-pip-does-not-support-python-re","errorCode":null,"errorMessage":"This version of pip does not support python {} (requires >={}).","messagePattern":"This version of pip does not support python (.+?) \\(requires >=(.+?)\\)\\.","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"critical","filePath":"src/pip/__pip-runner__.py","lineNumber":20,"sourceCode":"\nThis file is named as it is, to ensure that this module can't be imported via\nan import statement.\n\"\"\"\n\n# /!\\ This version compatibility check section must be Python 2 compatible. /!\\\n\nimport sys\n\n# Copied from pyproject.toml\nPYTHON_REQUIRES = (3, 10)\n\n\ndef version_str(version):  # type: ignore\n    return \".\".join(str(v) for v in version)\n\n\nif sys.version_info[:2] < PYTHON_REQUIRES:\n    raise SystemExit(\n        \"This version of pip does not support python {} (requires >={}).\".format(\n            version_str(sys.version_info[:2]), version_str(PYTHON_REQUIRES)\n        )\n    )\n\n# From here on, we can use Python 3 features, but the syntax must remain\n# Python 2 compatible.\n\nimport runpy  # noqa: E402\nfrom importlib.machinery import PathFinder  # noqa: E402\nfrom os.path import dirname  # noqa: E402\n\nPIP_SOURCES_ROOT = dirname(dirname(__file__))\n\n\nclass PipImportRedirectingFinder:\n    @classmethod\n    def find_spec(self, fullname, path=None, target=None):  # type: ignore","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/pypa/pip/blob/d7d0d0a39494e28ec1c407bd0680e4a4d1067791/src/pip/__pip-runner__.py#L2-L38","documentation":"Raised when the pip runner shim (__pip-runner__.py) is executed under a Python interpreter whose version is below pip's minimum supported version (currently 3.10, defined by PYTHON_REQUIRES). This is a hard gate at the very top of the runner module, before any pip internals are imported, using only Python 2-compatible syntax so it works on any interpreter. It exits the process via SystemExit rather than a standard exception.","triggerScenarios":"Invoking `python -m pip` (or the embedded __pip-runner__.py) with a Python 3.9 or earlier interpreter. Also triggered when a tool or build system calls `get_runnable_pip()` / the pip runner shim from an older Python, or when a user accidentally runs a modern pip checkout on a legacy interpreter.","commonSituations":"Running pip from source (development checkout) on a system default Python that is too old. CI images pinned to Python 3.9 or earlier that pull latest pip. Upgrading pip on a system that still has multiple Python versions and invoking the wrong one.","solutions":["Switch to a Python interpreter >= 3.10 (e.g., `python3.10 -m pip ...`).","If you must use an older Python, install a pip version whose PYTHON_REQUIRES matches (e.g., pip 24.x supports 3.8+).","Check `python --version` and verify your PATH or virtualenv points to the correct interpreter.","In CI, update the base image to one shipping Python 3.10+."],"exampleFix":"# before\npython3.9 -m pip install foo\n\n# after\npython3.10 -m pip install foo","handlingStrategy":"validation","validationCode":"import sys\nPYTHON_REQUIRES = (3, 10)\nif sys.version_info[:2] < PYTHON_REQUIRES:\n    print(f\"Python >={'.'.join(map(str, PYTHON_REQUIRES))} required, got {'.'.join(map(str, sys.version_info[:2]))}\")\n    sys.exit(1)","typeGuard":"def is_python_supported() -> bool:\n    import sys\n    return sys.version_info[:2] >= (3, 10)","tryCatchPattern":null,"preventionTips":["Always check python --version before running pip from source.","Pin your CI Python image to >= 3.10.","Use pyenv or a version manager to maintain the minimum supported Python."],"tags":["python-version","compatibility","runtime","system-exit"],"analyzedSha":"d7d0d0a39494e28ec1c407bd0680e4a4d1067791","analyzedAt":"2026-08-04T20:55:04.259Z","schemaVersion":2}