{
  "id": "pip/conflict-with-requirements-txt-and-pip-freeze",
  "signature": "ERROR: pip's dependency resolver detected conflicting requirements. The requirements.txt file contains '<package>==1.0' but pip freeze shows '<package>==2.0' installed.",
  "signature_zh": "错误：pip 的依赖解析器检测到冲突的要求。requirements.txt 文件包含 '<package>==1.0'，但 pip freeze 显示已安装 '<package>==2.0'。",
  "regex": "ERROR: pip's dependency resolver detected conflicting requirements\\. The requirements\\.txt file contains '[^']+' but pip freeze shows '[^']+' installed\\.",
  "domain": "pip",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The user has a pinned version in requirements.txt that differs from the currently installed version, and pip's resolver cannot reconcile the conflict because the installed version violates the constraint.",
  "root_cause_type": "generic",
  "root_cause_zh": "用户在 requirements.txt 中固定了一个与当前已安装版本不同的版本，pip 的解析器无法协调此冲突，因为已安装的版本违反了约束。",
  "versions": [
    {
      "version": "pip 22.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 23.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 23.2.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The upgrade may break other dependencies that rely on the newer version; pip's resolver will still complain if the upgrade is not possible due to other constraints.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This removes the constraint entirely, but pip may still detect the version mismatch if the package is a dependency of another package in the file.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Update requirements.txt to match the installed version: run `pip freeze | grep <package>` and replace the version in requirements.txt with the output. Example: `pip freeze | grep requests` then set `requests==2.31.0` in requirements.txt.",
      "success_rate": 0.9,
      "how": "Update requirements.txt to match the installed version: run `pip freeze | grep <package>` and replace the version in requirements.txt with the output. Example: `pip freeze | grep requests` then set `requests==2.31.0` in requirements.txt.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `--ignore-installed` with pip install to bypass the check: `pip install -r requirements.txt --ignore-installed <package>`",
      "success_rate": 0.75,
      "how": "Use `--ignore-installed` with pip install to bypass the check: `pip install -r requirements.txt --ignore-installed <package>`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "更新 requirements.txt 以匹配已安装的版本：运行 `pip freeze | grep <package>` 并将 requirements.txt 中的版本替换为输出。示例：`pip freeze | grep requests` 然后在 requirements.txt 中设置 `requests==2.31.0`。",
    "使用 `--ignore-installed` 与 pip install 绕过检查：`pip install -r requirements.txt --ignore-installed <package>`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/topics/repeatable-installs/#using-requirements-files",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-03-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}