An asynchronous Python Jupyter kernel built on AnyIO:
- runs in a separate process or in-process.
- supports top-level
await.
For a standalone, out-of-process kernel, install the subprocess extra:
pip install "akernel[subprocess]"This will give you a Python 3 (akernel) in JupyterLab.
akernel can also run in-process with Jupyverse.
Install it with:
pip install "fps-akernel-task"This will give you both Python 3 (akernel-task) and Python 3 (akernel-thread) kernels
in JupyterLab.
| Kernelspec | Execution in Jupyverse | Interrupt mode |
|---|---|---|
akernel |
Separate process | Signal |
akernel-task |
In-process, on the server event loop | Message |
akernel-thread |
In-process, in a worker thread | Message |
To refresh the kernelspecs in an existing installation, run:
akernel install --mode process
akernel install --mode task
akernel install --mode threadThe default mode is process.
akernel-task runs in Jupyverse's process, so running blocking user code in the kernel
will also block Jupyverse.
akernel-thread is an in-process kernel that runs user code in a separate thread,
which won't block Jupyverse.
- Cell output redirection currently uses the kernel's
printfunction rather than capturing all writes tostdoutandstderr. - In-process kernels cannot be interrupted while running blocking code.