{"record":{"id":"9dee09ca8339d240","repo":"pypa/pip","slug":"python-3-8-or-later-is-required","errorCode":null,"errorMessage":"Python 3.8 or later is required","messagePattern":"Python 3\\.8 or later is required","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"src/pip/_vendor/pkg_resources/__init__.py","lineNumber":28,"sourceCode":"to have their path parts separated with ``/``, *not* whatever the local\npath separator is.  Do not use os.path operations to manipulate resource\nnames being passed into the API.\n\nThe package resource API is designed to work with normal filesystem packages,\n.egg files, and unpacked .egg files.  It can also work in a limited way with\n.zip files and with custom PEP 302 loaders that support the ``get_data()``\nmethod.\n\nThis module is deprecated. Users are directed to :mod:`importlib.resources`,\n:mod:`importlib.metadata` and :pypi:`packaging` instead.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport sys\n\nif sys.version_info < (3, 8):  # noqa: UP036 # Check for unsupported versions\n    raise RuntimeError(\"Python 3.8 or later is required\")\n\nimport os\nimport io\nimport time\nimport re\nimport types\nfrom typing import (\n    Any,\n    Literal,\n    Dict,\n    Iterator,\n    Mapping,\n    MutableSequence,\n    NamedTuple,\n    NoReturn,\n    Tuple,\n    Union,\n    TYPE_CHECKING,","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_vendor/pkg_resources/__init__.py#L10-L46","documentation":"A module-level guard at the top of pkg_resources.__init__ that raises RuntimeError if the running Python interpreter is older than 3.8. Because it executes at import time, importing pkg_resources (or any code that imports it) on Python 3.7 or earlier immediately aborts with this message. pkg_resources is deprecated and has dropped support for old Python versions.","triggerScenarios":"Running `import pkg_resources` on CPython 3.7 or older; running a tool that transitively imports pip._vendor.pkg_resources on a legacy interpreter.","commonSituations":"A CI job or Docker image still pinned to Python 3.7; a system Python on an older OS (e.g. older Debian/Ubuntu) where a script invokes pip/setuptools vendored pkg_resources; upgrading pip/setuptools on an old Python.","solutions":["Upgrade the Python interpreter to 3.8 or newer (3.8 itself is EOL — prefer 3.10+).","Update the base Docker image to one shipping a supported Python version.","Pin to an older pkg_resources/setuptools/pip release that supports your interpreter only as a temporary bridge, then migrate."],"exampleFix":"// before\n# Dockerfile\nFROM python:3.7-slim\nRUN pip install setuptools\n// after\nFROM python:3.11-slim\nRUN pip install setuptools","handlingStrategy":"validation","validationCode":"import sys\nif sys.version_info < (3, 8):\n    raise SystemExit('Python 3.8+ required; current: ' + sys.version)\nimport pkg_resources","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare python_requires='>=3.8' in your packaging config.","Pin CI/Docker base images to Python 3.10+.","Document the minimum Python version prominently."],"tags":["runtime","python-version","packaging","environment"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}