{ "cells": [ { "cell_type": "markdown", "id": "9a8f2f85", "metadata": {}, "source": [ "# `asyncio` example\n", "\n", "From IPython≥7.0 you can use `asyncio` directly in Jupyter Notebooks, see also [IPython 7.0, Async REPL](https://blog.jupyter.org/ipython-7-0-async-repl-a35ce050f7f7).\n", "\n" ] }, { "cell_type": "markdown", "id": "a728279f", "metadata": {}, "source": [ "If you get `RuntimeError: This event loop is already running`, [nest-asyncio] might help you.\n", "\n", "You can install the package with\n", "\n", "``` bash\n", "$ uv add nest-asyncio\n", "```\n", "\n", "You can then import it into your notebook and use it with:" ] }, { "cell_type": "code", "execution_count": 1, "id": "45aacd96", "metadata": {}, "outputs": [], "source": [ "import nest_asyncio\n", "\n", "\n", "nest_asyncio.apply()" ] }, { "cell_type": "markdown", "id": "109900af", "metadata": {}, "source": [ "