{"id":"44aa01424d2cf8aa","repo":"aio-libs/aiohttp","slug":"aiohttp-4-x-requires-python-3-10","errorCode":null,"errorMessage":"aiohttp 4.x requires Python 3.10+","messagePattern":"aiohttp 4\\.x requires Python 3\\.10\\+","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"setup.py","lineNumber":9,"sourceCode":"import os\nimport pathlib\nimport sys\n\nfrom setuptools import Extension, setup\nfrom setuptools.command.build_ext import build_ext\n\nif sys.version_info < (3, 10):\n    raise RuntimeError(\"aiohttp 4.x requires Python 3.10+\")\n\n\nUSE_SYSTEM_DEPS = bool(\n    os.environ.get(\"AIOHTTP_USE_SYSTEM_DEPS\", os.environ.get(\"USE_SYSTEM_DEPS\"))\n)\nNO_EXTENSIONS: bool = bool(os.environ.get(\"AIOHTTP_NO_EXTENSIONS\"))\nCYTHON_TRACING: bool = bool(os.environ.get(\"AIOHTTP_CYTHON_TRACE\"))\nHERE = pathlib.Path(__file__).parent\nIS_GIT_REPO = (HERE / \".git\").exists()\n\n\nif sys.implementation.name != \"cpython\":\n    NO_EXTENSIONS = True\n\n\nif (\n    not USE_SYSTEM_DEPS\n    and IS_GIT_REPO","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/aio-libs/aiohttp/blob/c0ef574e29109210e96e652771ae4e7b88615fa4/setup.py#L1-L27","documentation":"Raised by setup.py at install time when the running interpreter is older than Python 3.10. aiohttp 4.x dropped support for Python < 3.10, so the build gates on sys.version_info and aborts before any extension compilation or packaging. This is a hard version floor, not a soft warning.","triggerScenarios":"Running `pip install aiohttp` (from sdist) or `pip install -e .` in this repo on Python 3.9 or earlier. The check at setup.py:8-9 raises RuntimeError immediately.","commonSituations":"A project or CI image still pinned to Python 3.9 attempting to install aiohttp 4.x; upgrading aiohttp without upgrading the runtime; a base image whose default python is 3.9; an old virtualenv used to build aiohttp.","solutions":["Upgrade the interpreter to Python 3.10 or newer and reinstall aiohttp in a fresh venv.","Pin aiohttp to the 3.x line (`aiohttp<4`) if you must stay on Python 3.9.","Update CI/Docker base images to a 3.10+ Python before installing."],"exampleFix":"# before: python 3.9\npip install aiohttp  # -> RuntimeError: aiohttp 4.x requires Python 3.10+\n\n# after: use python 3.10+\npython3.10 -m venv .venv && . .venv/bin/activate\npip install aiohttp","handlingStrategy":"validation","validationCode":"import sys\n\ndef assert_python_310():\n    if sys.version_info < (3, 10):\n        raise RuntimeError(\"aiohttp 4.x requires Python 3.10+\")","typeGuard":"import sys\n\ndef supports_aiohttp4() -> bool:\n    return sys.version_info >= (3, 10)","tryCatchPattern":null,"preventionTips":["Install aiohttp 4.x only on Python 3.10+.","Pin `aiohttp<4` in requirements if you must stay on 3.9.","Bump base images/CI Python to 3.10+ before upgrading aiohttp."],"tags":["install","python-version","setup","environment"],"analyzedSha":"c0ef574e29109210e96e652771ae4e7b88615fa4","analyzedAt":"2026-08-04T19:51:05.467Z","schemaVersion":2}