python security_error ai_generated true

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

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

ID: python/pip-hash-mismatch

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

版本兼容性

版本状态引入弃用备注
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

根因分析

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

English

The downloaded package does not match the expected hash specified in the requirements file, possibly due to corruption or a man-in-the-middle attack.

generic

解决方案

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

无效尝试

常见但无效的做法:

  1. 20% 失败

    This bypasses security checks and may install compromised packages.

  2. 50% 失败

    If the source is compromised, re-downloading may fetch the same wrong hashes.