python install_error ai_generated true

错误:这些包与需求文件中的哈希不匹配。如果您更新了包版本,请更新哈希。

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes.

ID: python/pip-install-hash-mismatch

其他格式: JSON · Markdown 中文 · English
80%修复率
86%置信度
0证据数
2024-08-30首次发现

版本兼容性

版本状态引入弃用备注
3.x active

根因分析

下载的包的哈希与需求文件中指定的哈希不匹配,表明下载损坏或包已更改。

English

The downloaded package's hash does not match the hash specified in the requirements file, indicating a corrupted download or a changed package.

generic

解决方案

  1. 90% 成功率
    pip hash package.whl  # then update requirements.txt with new hash
  2. 85% 成功率
    pip install --require-hashes -r requirements.txt  # after updating hashes

无效尝试

常见但无效的做法:

  1. 70% 失败

    Loses the security benefit of hash checking; not recommended.

  2. 60% 失败

    If the package on the index has changed, retrying will still fail.