{
  "id": "python/pip-normalize-name-case-mismatch",
  "signature": "ERROR: Cannot install Foo-Bar==1.0 and foo_bar==1.1 because these package versions have conflicting dependencies.",
  "signature_zh": "错误：无法同时安装 Foo-Bar==1.0 和 foo_bar==1.1，因为这些包版本存在依赖冲突。",
  "regex": "ERROR:\\ Cannot\\ install\\ Foo\\-Bar==1\\.0\\ and\\ foo_bar==1\\.1\\ because\\ these\\ package\\ versions\\ have\\ conflicting\\ dependencies\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Two requirement lines specify the same distribution using different name spellings; PEP 503 normalization treats them as equal, so pinning two versions conflicts.",
  "root_cause_type": "generic",
  "root_cause_zh": "两行依赖使用不同的名称拼写指定了同一个分发包；PEP 503 规范化将它们视为相同，因此固定两个版本会冲突。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Skips dependency resolution but the two conflicting top-level pins still cannot coexist.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Force-reinstall does not reconcile versions; the resolver still reports the conflict.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "python - <<'PY'\nfrom packaging.utils import canonicalize_name\nseen = {}\nfor line in open('requirements.txt'):\n    line = line.strip()\n    if not line or line.startswith('#'):\n        continue\n    name = line.split('==')[0]\n    canon = canonicalize_name(name)\n    if canon in seen:\n        print('duplicate:', line, 'vs', seen[canon])\n    else:\n        seen[canon] = line\nPY",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.98,
      "how": "# requirements.txt\nfoo-bar==1.1\n# remove the duplicate foo_bar==1.0 line\npip install -r requirements.txt",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}