Create a JupyterLite archive that can be used offline#

It is possible to create a fully self-contained JupyterLite archive with no request to external services.

Configure Pyolite#

By default the Pyodide files are fetched from a CDN.

The full Pyodide distribution can be pretty heavy (~180MB), but it’s possible to self-host it.

Use the --pyodide flag to specify the Pyodide distribution you would like to use. For example:

jupyter lite build --pyodide


Generally, a version of pyolite is likely only compatible with variants of the same x.y.z version against which the release was tested, as both python and JS APIs are still changing frequently on both sides of the dependency.

Configure Mathjax#

By default Mathjax is fetched from a CDN.

To retrieve the static asssets at built time and serve them alongside the main website assets, make sure to install jupyterlite with pip install jupyterlite[mathjax].

Configure the piplite wheels#

By default calling %pip install or piplite.install() downloads and installs packages from the public PyPI.

Instead you can configure a list of packages that will be downloaded at build time so they can be hosted alongside your JupyterLite website.

See Ship additional pyolite wheels at build time for more information.

Concretely that means populating a list of URLs for downloading wheels. A good example for this is the configuration used for the JupyterLite demo website: jupyter_lite_config.json

The relevant part of jupyter_lite_config.json is the piplite_urls list which looks like the following:

  "PipliteAddon": {
    "piplite_urls": [

Tweak this list based on the packages you would like to serve statically.


Check out the CLI Reference for more details.