python config_error ai_generated true

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

ERROR: Unsupported hash name 'sha512' for package 'foo'

ID: python/pip-install-error-unsupported-hash-algorithm

其他格式: JSON · Markdown 中文 · English
80%修复率
84%置信度
0证据数
2025-09-20首次发现

版本兼容性

版本状态引入弃用备注
3.7 active — — —
3.8 active — — —
3.9 active — — —
3.10 active — — —

根因分析

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

English

The requirements file specifies a hash algorithm that pip does not support in the current version or environment. pip typically supports sha256, sha384, sha512, but older versions may not.

generic

解决方案

  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.

无效尝试

常见但无效的做法:

  1. 70% 失败

    Disables hash checking, reducing security and potentially allowing tampered packages.

  2. 90% 失败

    Doesn't address the hash algorithm issue; still fails.