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!
Currently supported kernels are:
Try it here!
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://repo.prefix.dev/emscripten-forge-dev
- https://repo.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
magic or the %mamba
magics to install packages dynamically once the kernel started:
%pip install my_package
or
%mamba install my_package
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://repo.prefix.dev/emscripten-forge-dev
- https://repo.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.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