python data_error ai_generated true

错误:setuptools.errors.VersionError:版本 '1.0.0' 无效:期望在 '1' 后出现 '.' 或字符串结尾

ERROR: setuptools.errors.VersionError: Version '1.0.0' is invalid: expected '.' or end of string after '1'

ID: python/setuptools-version-scheme-error

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
0证据数
2025-08-15首次发现

版本兼容性

版本状态引入弃用备注
3.8 active — — —
3.9 active — — —

根因分析

版本字符串包含 setuptools 无法解析的无效字符或格式,例如使用逗号或空格。

English

The version string contains invalid characters or format that setuptools cannot parse, e.g., using commas or spaces.

generic

解决方案

  1. 95% 成功率 Use a valid PEP 440 version string
    Change to '1.0.0' (ensure only dots and digits).
  2. 90% 成功率 Use setuptools_scm to auto-generate versions from git tags
    Install setuptools_scm and configure in setup.cfg: [tool:setuptools_scm]

无效尝试

常见但无效的做法:

  1. Adding a trailing 'v' to the version 90% 失败

    Versions must start with a digit.

  2. Using a version like '1,0,0' with commas 80% 失败

    Commas are not valid separators.