# 错误：无效的需求：'package>=1.0,<2.0'（来自requirements.txt第1行）- 预期结束或分号

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

## 根因

需求字符串包含逗号分隔的版本说明符，但缺少正确空格或运算符格式错误，导致解析失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.9 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Rewrite as 'package>=1.0, <2.0' (with space after comma) or 'package>=1.0,<2.0' (no space but valid)
   ```
2. **** (90% 成功率)
   ```
   sed -i 's/>=1.0,<2.0/>=1.0,<2.0/' requirements.txt && pip install -r requirements.txt
   ```
3. **** (85% 成功率)
   ```
   Create constraints.txt with 'package>=1.0,<2.0' and use pip install -c constraints.txt
   ```

## 无效尝试

- **** — Invalid syntax; pip requires comma or space between specifiers. (100% 失败率)
- **** — Quotes don't fix the parser error; it's about the specifier format. (90% 失败率)
- **** — Pip aborts the entire installation. (80% 失败率)
