# pkg_resources.extern.packaging.requirements.InvalidRequirement: 期望结尾或分号（版本说明符之后）
    foo>=1.0<2.0
        ~~~~^

- **ID:** `python/setuptools-version-parse-error-invalid-requirement`
- **领域:** python
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

某个依赖字符串包含两个未用逗号分隔的版本说明符（如 `>=1.0<2.0`），PEP 508 解析器会拒绝。

## 版本兼容性

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

## 解决方案

1. **** (98% 成功率)
   ```
   Insert a comma between specifiers: `foo>=1.0,<2.0` in install_requires / pyproject.toml.
   ```
2. **** (90% 成功率)
   ```
   Validate requirements with `python -c "from packaging.requirements import Requirement; Requirement('foo>=1.0,<2.0')"` before packaging.
   ```

## 无效尝试

- **** — They are not shell metacharacters inside a Python string; escaping does nothing. (90% 失败率)
- **** — The string is genuinely malformed regardless of parser version. (80% 失败率)
