{
  "id": "python/flask-importerror-cannot-import-name-from-flask",
  "signature": "ImportError: cannot import name 'request' from 'flask'",
  "signature_zh": "导入错误：无法从'flask'导入名称'request'",
  "regex": "ImportError:\\ cannot\\ import\\ name\\ 'request'\\ from\\ 'flask'",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "Trying to import a name that does not exist in the flask module, possibly due to typo or wrong submodule.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试从flask模块导入一个不存在的名称，可能是由于拼写错误或错误的子模块。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Assuming request is a direct attribute of flask",
      "why_fails": "request is in flask module, but import should be 'from flask import request'.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using old Flask version without the attribute",
      "why_fails": "Some attributes may be added in later versions.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Correct the import statement",
      "success_rate": 0.95,
      "how": "from flask import request",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check available imports with dir",
      "success_rate": 0.85,
      "how": "import flask; print([x for x in dir(flask) if not x.startswith('_')])",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}