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

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

## 根因

下载的包与需求文件中指定的预期哈希值不匹配，可能是由于损坏或中间人攻击。

## 版本兼容性

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

## 解决方案

1. **** (90% 成功率)
   ```
   pip hash package.whl  # generate new hash and replace in file
   ```
2. **** (80% 成功率)
   ```
   PIP_REQUIRE_HASHES=0 pip install package
   ```

## 无效尝试

- **** — This bypasses security checks and may install compromised packages. (20% 失败率)
- **** — If the source is compromised, re-downloading may fetch the same wrong hashes. (50% 失败率)
