{
  "id": "python/pip-unicode-decode-error-in-metadata",
  "signature": "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)",
  "signature_zh": "UnicodeDecodeError: 'ascii' 编解码器无法解码位置 42 的字节 0xe2：序数不在范围(128)内",
  "regex": "UnicodeDecodeError:\\ 'ascii'\\ codec\\ can't\\ decode\\ byte\\ 0xe2\\ in\\ position\\ 42:\\ ordinal\\ not\\ in\\ range\\(128\\)",
  "domain": "python",
  "category": "encoding_error",
  "subcategory": null,
  "root_cause": "A package's metadata file (e.g., PKG-INFO, setup.py) contains non-ASCII characters without proper encoding declaration. pip's metadata parser defaults to ASCII in some environments.",
  "root_cause_type": "generic",
  "root_cause_zh": "包的元数据文件（如 PKG-INFO、setup.py）包含非 ASCII 字符，但没有正确的编码声明。pip 的元数据解析器在某些环境中默认使用 ASCII。",
  "versions": [
    {
      "version": "3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Affects I/O encoding, not the encoding used when reading package files.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The issue is in the package's metadata, not pip.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.75,
      "how": "Download the package source, edit the metadata file to add an encoding declaration (e.g., # -*- coding: utf-8 -*-), and install locally.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.7,
      "how": "Report the issue to the package maintainer; meanwhile, try installing an older version that may not have the problematic characters.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-12-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}