python data_error ai_generated true

ERROR: Invalid version: '1.0.0-beta' - Must start with a number

ID: python/packaging-version-parsing-failure

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active
3.9 active

Root Cause

The version string does not conform to PEP 440, e.g., using non-numeric prerelease tags.

generic

中文

版本字符串不符合 PEP 440 规范,例如使用了非数字的预发布标签。

Workarounds

  1. 95% success Use a valid PEP 440 version string
    Change to '1.0.0b1' or '1.0.0-beta.1' (but '1.0.0b1' is preferred).
  2. 95% success Use packaging.version.Version with a corrected string
    Run: from packaging.version import Version; v = Version('1.0.0b1')

Dead Ends

Common approaches that don't work:

  1. Adding a leading 'v' like 'v1.0.0-beta' 90% fail

    PEP 440 requires versions to start with a digit, not a letter.

  2. Using underscores instead of dashes 80% fail

    Underscores are not valid separators in PEP 440 versions.