{
  "id": "python/matplotlib-findfont-cache-stale",
  "signature": "findfont: Font family 'Arial' not found.",
  "signature_zh": "findfont: 未找到字体族 'Arial'。",
  "regex": "findfont:\\ Font\\ family\\ 'Arial'\\ not\\ found\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The requested font is not installed on the system, or matplotlib's font cache is stale after installing a new font.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求的字体未安装在系统上，或安装新字体后 matplotlib 的字体缓存已过期。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The font file is genuinely absent; naming it does not create it.",
      "fail_rate": 0.93,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Upgrading matplotlib does not install OS-level font packages.",
      "fail_rate": 0.88,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "sudo apt-get install -y fonts-liberation\nrm -rf ~/.cache/matplotlib\npython -c \"import matplotlib.font_manager as fm; fm._load_fontmanager(try_read_cache=False)\"",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "import matplotlib.pyplot as plt\nplt.rcParams['font.family'] = 'DejaVu Sans'  # shipped with matplotlib",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}