python data_error ai_generated partial

packaging.version.InvalidVersion: Invalid version: '1.0.0.post'

ID: python/pip-version-parse-legacy-epoch

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2024-12-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

Root Cause

A package published a version string that violates PEP 440 (e.g. trailing '.post' without a number), causing packaging.version to raise during resolution.

generic

中文

某个包发布了违反 PEP 440 的版本字符串(例如末尾的 '.post' 没有数字),导致 packaging.version 在解析时抛出异常。

Workarounds

  1. 90% success
    pip install https://files.pythonhosted.org/packages/.../somepkg-1.0.0-py3-none-any.whl
  2. 70% success
    pip install --upgrade pip packaging
    pip install somepkg

Dead Ends

Common approaches that don't work:

  1. 90% fail

    The malformed version is not a pre-release; parsing still fails before any filter applies.

  2. 75% fail

    If the index metadata includes the malformed version, pip still parses all versions and errors.