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
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.
解决方案
-
95% 成功率 Use a valid PEP 440 version string
Change to '1.0.0' (ensure only dots and digits).
-
90% 成功率 Use setuptools_scm to auto-generate versions from git tags
Install setuptools_scm and configure in setup.cfg: [tool:setuptools_scm]
无效尝试
常见但无效的做法:
-
Adding a trailing 'v' to the version
90% 失败
Versions must start with a digit.
-
Using a version like '1,0,0' with commas
80% 失败
Commas are not valid separators.