# 错误：这些包与需求文件中的哈希不匹配。如果您已更新包版本，请更新哈希值。

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

## 根因

下载的 wheel/sdist 的 SHA256 与 requirements.txt 中固定的哈希不匹配，可能是因为文件被重新上传、镜像提供不同的构建，或哈希行已过期。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   Regenerate the hashes with pip-tools:
  pip install pip-tools
  pip-compile --generate-hashes requirements.in
Then install:
  pip install -r requirements.txt
   ```
2. **** (90% 成功率)
   ```
   If you intentionally want to skip hashes temporarily, remove the --hash lines or the --require-hashes flag from the install command.
   ```

## 无效尝试

- **** — --no-deps skips dependency resolution, not hash verification; the check still runs. (90% 失败率)
- **** — --trusted-host only disables TLS verification, not hash verification. (95% 失败率)
