{
  "id": "python/pip-version-parse-invalid-version",
  "signature": "packaging.version.InvalidVersion: Invalid version: '1.0.0-rc.1+build.5.6.7.8.9.10'",
  "signature_zh": "packaging.version.InvalidVersion：无效版本：'1.0.0-rc.1+build.5.6.7.8.9.10'",
  "regex": "packaging\\.version\\.InvalidVersion:\\ Invalid\\ version:\\ '1\\.0\\.0\\-rc\\.1\\+build\\.5\\.6\\.7\\.8\\.9\\.10'",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A package version string does not conform to PEP 440. This often happens with custom-built or vendored packages whose version was set from a git describe or CI variable containing invalid characters.",
  "root_cause_type": "generic",
  "root_cause_zh": "包版本字符串不符合 PEP 440。这通常发生在自定义构建或内置包上，其版本从包含无效字符的 git describe 或 CI 变量设置而来。",
  "versions": [
    {
      "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": "Pre-release flag doesn't relax PEP 440 validation; the version string is still invalid.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Ignoring installed packages doesn't change version parsing.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.8,
      "how": "from packaging.version import Version, InvalidVersion\n\ndef normalize(v):\n    try:\n        return str(Version(v))\n    except InvalidVersion:\n        return v.replace('-rc.', 'rc').replace('+', '.post')\n\nprint(normalize('1.0.0-rc.1'))  # 1.0.0rc1",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "# in setup.py\nfrom setuptools import setup\nsetup(name='mypkg', version='1.0.0rc1')  # not 1.0.0-rc.1",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}