{
  "id": "python/uvloop-import-error",
  "signature": "ModuleNotFoundError: No module named 'uvloop'",
  "signature_zh": "ModuleNotFoundError: 没有名为 'uvloop' 的模块",
  "regex": "ModuleNotFoundError:\\ No\\ module\\ named\\ 'uvloop'",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "uvloop is not installed in the active environment, or it is installed for a different Python interpreter than the one running the app (common with venvs and multi-version setups).",
  "root_cause_type": "generic",
  "root_cause_zh": "当前环境中未安装 uvloop，或它安装在运行应用所用解释器之外的其他 Python 中（在 venv 与多版本环境中常见）。",
  "versions": [
    {
      "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"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Installs into the system Python, not the venv, so the app still cannot import it.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Mixes incompatible ABI builds and typically produces ImportError on the C extension.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "python -c 'import sys; print(sys.executable)'\npython -m pip install uvloop\npython -c 'import uvloop; print(uvloop.__version__)'",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "try:\n    import uvloop\n    uvloop.install()\nexcept ImportError:\n    pass  # use default asyncio loop",
      "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.89,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}