xeus kernels in JupyterLite 🚀🪐#
jupyterlite-xeus is an extension for JupyterLite that enables fully client-side Jupyter environments powered by xeus kernels compiled to WebAssembly (Wasm). It allows users to create statically-served Jupyter deployments with custom pre-built environments — no server required.
The core feature of jupyterlite-xeus is its integration with emscripten-forge, a conda package distribution tailored for WebAssembly. This makes it possible to bundle your favorite scientific or data analysis packages directly into the browser-based environment, delivering a reproducible computing experience with zero backend dependencies.
Ideal for demos, educational resources, and offline computing. Use it in combination with Voici!
A non-exhaustive list of supported kernels:
Try it here!
Quickstart#
The easiest way to deploy your Notebooks using xeus lite kernels is through Notebook.link, try it!
Alternatively, you can use the template repository https://github.com/jupyterlite/xeus-lite-demo to quickstart your own deployment of jupyterlite on Github pages including jupyterlite-xeus.
Installation#
You can install jupyterlite-xeus with conda/mamba
mamba install -c conda-forge jupyterlite-xeus
Or with pip (you must install micromamba 2.0.5):
pip install jupyterlite-xeus
Usage#
Once installed, you can create an environment.yml file at the root of your jupyterlite build directory containing the following:
name: xeus-kernels
channels:
- https://prefix.dev/emscripten-forge-4x
- https://prefix.dev/conda-forge
dependencies:
- xeus-python
- xeus-lua
- xeus-nelson
- numpy
- matplotlib
- pillow
- ipywidgets
- pip:
- ipycanvas
You can then run the usual jupyter lite build or voici my-notebook.ipynb. The environment.yml file will be picked-up automatically by jupyterlite-xeus, installing xeus-python, xeus-lua, xeus-nelson and some useful Python packages into the user environment.
Features#
Dynamic install of packages#
Starting with jupyterlite-xeus v4.0.0a11, you can use the %pip and %mamba magics or the !pip and !mamba commands to install packages dynamically once the kernel started:
%pip install my_package
!pip install my_package
or
%mamba install my_package
!mamba install my_package
Any command from conda, mamba, rattler to micromamba would work. They are all using the mambajs library for handling the solving.
stdin#
Starting with jupyterlite-xeus v4.0.0a8, latest jupyterlite 0.6.0, and latest xeus kernels (tested in Python, C++, lua), blocking stdin is now supported:
name = input("what's your name")
Multiple kernels#
To create a deployment with multiple kernels, you can simply add them to the environment.yml file:
name: xeus-lite-wasm
channels:
- https://prefix.dev/emscripten-forge-4x
- https://prefix.dev/conda-forge
dependencies:
- xeus-python
- xeus-lua
- xeus-sqlite
- numpy
Learn more in Emscripten Environment
Mounting additional files#
To copy additional files and directories into the virtual filesystem of the xeus-lite kernels you can use the --XeusAddon.mount option.
Each mount is specified as a pair of paths separated by a colon :. The first path is the path to the file or directory on the host machine, the second path is the path to the file or directory in the virtual filesystem of the kernel.
jupyter lite build \
--XeusAddon.environment_file=environment.yml \
--XeusAddon.mounts=/some/path/on/host_machine:/some/path/in/virtual/filesystem
Learn more in Accessing and managing files
Learn more#
- Deploy your own
- Emscripten Environment
- Accessing and managing files
- Advanced Configuration
- Changelog
- 4.5.2
- 4.5.1
- 4.5.0
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.7
- 4.3.6
- 4.3.5
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.3.0rc3
- 4.3.0rc2
- 4.3.0rc1
- 4.3.0rc0
- 4.3.0a3
- 4.3.0a2
- 4.3.0a1
- 4.3.0a0
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.2
- 4.1.1
- 4.1.0
- 4.1.0a2
- 4.1.0a1
- 4.1.0a0
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 4.0.0rc0
- 4.0.0b1
- 4.0.0b0
- 4.0.0a11
- 4.0.0a10
- 4.0.0a9
- 4.0.0a8
- 4.0.0a7
- 4.0.0a6
- 4.0.0a5
- 4.0.0a4
- 4.0.0a3
- 4.0.0a2
- 4.0.0a1
- 4.0.0a0
- 3.1.1
- 3.1.0
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0a3
- 3.0.0a2
- 3.0.0a1
- 3.0.0a0
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 0.2.0b0
- 0.2.0a3
- 0.2.0a2
- 0.2.0a1
- 0.2.0a0
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- 0.1.0a4
- 0.1.0a3
- 0.1.0a2
- 0.1.0a1