python
data_error
ai_generated
partial
packaging.version.InvalidVersion: Invalid version: '1.0.0.post'
ID: python/pip-version-parse-legacy-epoch
80%Fix Rate
85%Confidence
0Evidence
2024-12-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 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
-
90% success
pip install https://files.pythonhosted.org/packages/.../somepkg-1.0.0-py3-none-any.whl
-
70% success
pip install --upgrade pip packaging pip install somepkg
Dead Ends
Common approaches that don't work:
-
90% fail
The malformed version is not a pre-release; parsing still fails before any filter applies.
-
75% fail
If the index metadata includes the malformed version, pip still parses all versions and errors.