# 错误：无效的依赖项：'requests==2.31.0 --no-deps'

- **ID:** `python/pip-invalid-requirement-no-such-option`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pip 将依赖项字符串按 PEP 508 语法解析；像 --no-deps 这样的标志不能嵌入到依赖项说明符中，必须作为单独的 CLI 参数传递。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (99% 成功率)
   ```
   pip install --no-deps 'requests==2.31.0'
   ```
2. **** (98% 成功率)
   ```
   echo 'requests==2.31.0' > req.txt
pip install --no-deps -r req.txt
   ```

## 无效尝试

- **** — Quoting does not change parsing; pip still treats the quoted text as one requirement and rejects the option token. (85% 失败率)
- **** — requirements.txt lines are requirement specifiers, not command lines; pip errors out on the same Invalid requirement message. (90% 失败率)
- **** — Backslashes are not valid in PEP 508 requirement names and produce a different parse error. (95% 失败率)
