{
  "id": "pip/error-installing-package-with-python-version-not-in-range-from-requirements-txt",
  "signature": "ERROR: Package 'X' requires a different Python: X.Y not in '>=3.8,<3.11'",
  "signature_zh": "错误：包 'X' 需要不同的 Python 版本：X.Y 不在 '>=3.8,<3.11' 范围内",
  "regex": "ERROR: Package '[^']+' requires a different Python: [0-9]+\\.[0-9]+ not in '[^']+'",
  "domain": "pip",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The current Python interpreter version does not satisfy the package's python_requires constraint specified in its metadata.",
  "root_cause_type": "generic",
  "root_cause_zh": "当前 Python 解释器版本不满足包元数据中指定的 python_requires 约束。",
  "versions": [
    {
      "version": "pip 20.3+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Python 3.8-3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using --ignore-requires-python flag to bypass the check",
      "why_fails": "This flag does not exist in pip; it is a common misconception from conda or other tools.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Installing a different version of the package with --no-deps",
      "why_fails": "The python_requires constraint is checked before dependency resolution; --no-deps does not bypass it.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Creating a virtual environment with the same Python version but different name",
      "why_fails": "The Python version in the virtual environment is still the same; the constraint is version-based, not environment-based.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Create a new virtual environment with a compatible Python version: python3.9 -m venv myenv && source myenv/bin/activate && pip install <package>",
      "success_rate": 0.95,
      "how": "Create a new virtual environment with a compatible Python version: python3.9 -m venv myenv && source myenv/bin/activate && pip install <package>",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use pyenv to install a compatible Python version: pyenv install 3.10.11 && pyenv local 3.10.11 && pip install <package>",
      "success_rate": 0.9,
      "how": "Use pyenv to install a compatible Python version: pyenv install 3.10.11 && pyenv local 3.10.11 && pip install <package>",
      "condition": "",
      "sources": []
    },
    {
      "action": "Install an older version of the package that supports your Python version: pip install <package>==<version_that_supports_your_python>",
      "success_rate": 0.85,
      "how": "Install an older version of the package that supports your Python version: pip install <package>==<version_that_supports_your_python>",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "创建一个具有兼容 Python 版本的新虚拟环境：python3.9 -m venv myenv && source myenv/bin/activate && pip install <包名>",
    "使用 pyenv 安装兼容的 Python 版本：pyenv install 3.10.11 && pyenv local 3.10.11 && pip install <包名>",
    "安装支持您当前 Python 版本的旧版本包：pip install <包名>==<支持您Python的版本>"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-07-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}