{ "cells": [ { "cell_type": "markdown", "id": "03c941ae", "metadata": {}, "source": [ "# `asyncio` Beispiel\n", "\n", "Ab IPython≥7.0 könnt ihr `asyncio` direkt in Jupyter Notebooks verwenden; seht auch [IPython 7.0, Async REPL](https://blog.jupyter.org/ipython-7-0-async-repl-a35ce050f7f7)." ] }, { "cell_type": "markdown", "id": "a728279f", "metadata": {}, "source": [ "Wenn ihr die Fehlermeldung `RuntimeError: This event loop is already running` erhaltet, hilft euch vielleicht [nest-asyncio] weiter.\n", "\n", "Ihr könnt das Paket in eurer Jupyter- oder JupyterHub-Umgebung installieren mit\n", "\n", "``` bash\n", "$ uv add nest-asyncio\n", "```\n", "\n", "Ihr könnt es dann in euer Notebook importieren und verwenden mit:" ] }, { "cell_type": "code", "execution_count": 1, "id": "45aacd96", "metadata": { "execution": { "iopub.execute_input": "2026-05-21T22:44:51.004264Z", "iopub.status.busy": "2026-05-21T22:44:51.003962Z", "iopub.status.idle": "2026-05-21T22:44:51.009895Z", "shell.execute_reply": "2026-05-21T22:44:51.009544Z", "shell.execute_reply.started": "2026-05-21T22:44:51.004245Z" } }, "outputs": [], "source": [ "import nest_asyncio\n", "\n", "\n", "nest_asyncio.apply()" ] }, { "cell_type": "markdown", "id": "3d44ea02", "metadata": {}, "source": [ "