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

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

## 根因

下载的包哈希与带有--hash约束的requirements文件中指定的哈希不匹配。

## 版本兼容性

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

## 解决方案

1. **Update hashes in requirements file** (90% 成功率)
   ```
   pip hash package.whl
# Update the hash in requirements.txt
   ```
2. **Regenerate requirements file with hashes** (85% 成功率)
   ```
   pip freeze --hash > requirements.txt
   ```

## 无效尝试

- **Ignoring hashes with --no-hash-check** — Bypasses security checks; may install malicious package. (40% 失败率)
- **Re-downloading the same package** — Hash mismatch persists if package was updated on server. (80% 失败率)
