python config_error ai_generated true

error: invalid version '1.0.dev0' (expected a version number like '1.0')

ID: python/setuptools-development-version-error

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.5 active
3.6 active
3.7 active

Root Cause

setuptools' version parser rejects certain pre-release formats when not using PEP 440 compliant versioning.

generic

中文

当不使用符合 PEP 440 的版本控制时,setuptools 的版本解析器会拒绝某些预发布格式。

Workarounds

  1. 90% success
    In setup.py: version='1.0.dev0'  # actually PEP 440 allows this; ensure setuptools >= 40.8.0
  2. 85% success
    pip install --upgrade setuptools

Dead Ends

Common approaches that don't work:

  1. 30% fail

    Loses the dev marker and may confuse dependency resolution.

  2. 70% fail

    Deprecated and may cause other issues in modern environments.