{
  "id": "python/asyncio-runner-not-available",
  "signature": "RuntimeError: asyncio.run() is not available in this Python version",
  "signature_zh": "运行时错误：此 Python 版本中 asyncio.run() 不可用",
  "regex": "RuntimeError:\\ asyncio\\.run\\(\\)\\ is\\ not\\ available\\ in\\ this\\ Python\\ version",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Using asyncio.run() in Python 3.6 or earlier, where it was introduced in Python 3.7.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 Python 3.6 或更早版本中使用 asyncio.run()，该函数在 Python 3.7 中引入。",
  "versions": [
    {
      "version": "3.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using asyncio.get_event_loop().run_until_complete() without checking loop status",
      "why_fails": "If the loop is already running, this may cause 'Event loop is already running' error.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrading Python but not updating code",
      "why_fails": "The error is version-specific; upgrading Python resolves it but code may need adjustments.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use asyncio.get_event_loop().run_until_complete() on a new loop",
      "success_rate": 0.85,
      "how": "loop = asyncio.new_event_loop()\nasyncio.set_event_loop(loop)\nloop.run_until_complete(main())",
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrade Python to 3.7+",
      "success_rate": 0.95,
      "how": "python3 --version  # ensure >= 3.7",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-28",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}