{
  "id": "pip/requirements-hash-invalid-line",
  "signature": "ERROR: The line in requirements.txt has an invalid hash format: 'sha256:abc123...' The hash must be in the format 'sha256:...' (no spaces, lowercase).",
  "signature_zh": "错误：requirements.txt 中的行具有无效的哈希格式：'sha256:abc123...' 哈希必须采用 'sha256:...' 格式（无空格，小写）。",
  "regex": "ERROR: The line in requirements\\.txt has an invalid hash format: 'sha256:[^']+' The hash must be in the format 'sha256:\\.\\.\\.'",
  "domain": "pip",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A hash value in a requirements.txt file is malformed, e.g., contains uppercase letters, spaces, or incorrect algorithm prefix, causing pip to reject the entire line during hash verification.",
  "root_cause_type": "generic",
  "root_cause_zh": "requirements.txt 文件中的哈希值格式错误，例如包含大写字母、空格或错误的算法前缀，导致 pip 在哈希验证期间拒绝整行。",
  "versions": [
    {
      "version": "pip 23.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Pip strictly parses the hash format; any deviation from 'algorithm:hexdigest' causes rejection.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Without the algorithm prefix, pip cannot determine which hash function to use for verification.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Regenerate the hash using pip's built-in tool: pip hash /path/to/package.whl",
      "success_rate": 0.95,
      "how": "Regenerate the hash using pip's built-in tool: pip hash /path/to/package.whl",
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually correct the hash format in requirements.txt to lowercase and colon-separated: sha256:abcdef1234567890...",
      "success_rate": 0.9,
      "how": "Manually correct the hash format in requirements.txt to lowercase and colon-separated: sha256:abcdef1234567890...",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a hash generation script: python -c \"import hashlib; print('sha256:' + hashlib.sha256(open('package.whl','rb').read()).hexdigest())\"",
      "success_rate": 0.85,
      "how": "Use a hash generation script: python -c \"import hashlib; print('sha256:' + hashlib.sha256(open('package.whl','rb').read()).hexdigest())\"",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用 pip 内置工具重新生成哈希：pip hash /path/to/package.whl",
    "手动修正 requirements.txt 中的哈希格式为小写并用冒号分隔：sha256:abcdef1234567890...",
    "使用哈希生成脚本：python -c \"import hashlib; print('sha256:' + hashlib.sha256(open('package.whl','rb').read()).hexdigest())\""
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/topics/secure-installs/#hash-checking-mode",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2024-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}