Miscellaneous questions on the usage of JupyterLite

At some point we just need to make a %pip install magic work, but it will take some nasty rewriting to avoid hitting asyncio issues: in the interim, I guess don’t try to be too clever with asyncio tricks… run_until_complete generally won’t work due to hacks in both the ipython and pyodide stacks.

Regarding widgets: we’re working on an interim approach to supporting ipywidgets 8 and 7 in the same jupyterlite package by shipping two versions of the shim packages:

But even still, a site would need to ensure its labextension versions line up properly with the packages pip will bring in, and a requirements.txt that pins it, with piplite.install(['ipywidgets<7']). This is usually handled correctly if the default environment-sniffing is used.

Generally: once you get off the happy path of demos, it pays to do some of the more aggressive pinning techniques described in the jupyterlite docs… at some point, a pdm or pip-tools tool would likely make the most sense… while micropip has some newer features around freeze, they have other limitations (such as single versioning) that are somewhat challenging. And mainline pip… doesn’t really care about this use case.

1 Like