# packaging.version.InvalidVersion：无效版本：'1.0.0.post'

- **ID:** `python/pip-version-parse-legacy-epoch`
- **领域:** python
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

某个包发布了违反 PEP 440 的版本字符串（例如末尾的 '.post' 没有数字），导致 packaging.version 在解析时抛出异常。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   pip install https://files.pythonhosted.org/packages/.../somepkg-1.0.0-py3-none-any.whl
   ```
2. **** (70% 成功率)
   ```
   pip install --upgrade pip packaging
pip install somepkg
   ```

## 无效尝试

- **** — The malformed version is not a pre-release; parsing still fails before any filter applies. (90% 失败率)
- **** — If the index metadata includes the malformed version, pip still parses all versions and errors. (75% 失败率)
