# 错误：包 'foo' 不支持的哈希名称 'sha512'

- **ID:** `python/pip-install-error-unsupported-hash-algorithm`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

requirements 文件指定了 pip 在当前版本或环境中不支持的哈希算法。pip 通常支持 sha256、sha384、sha512，但旧版本可能不支持。

## 版本兼容性

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

## 解决方案

1. **** (90% 成功率)
   ```
   Upgrade pip to the latest version: python -m pip install --upgrade pip.
   ```
2. **** (95% 成功率)
   ```
   Change the hash algorithm to sha256 in requirements.txt, which is universally supported.
   ```

## 无效尝试

- **** — Disables hash checking, reducing security and potentially allowing tampered packages. (70% 失败率)
- **** — Doesn't address the hash algorithm issue; still fails. (90% 失败率)
