The best practice for pinning a Python library (or any kernel-side library) to a specific JupyterLab extension is to use a versioned MIME type or media type. A good example of this is the Altair Python library which supports multiple versions of Vega and Vega-lite and vega4-extension, vega3-extension, and vega2-extension which render Altair output.
In Jupyter notebooks, cell output areas contain one or more outputs of a given MIME type. The MIME type describes the data type of the output. The default MIME type is text/plain
. JupyterLab provides a set of mimerender extensions that render common MIME types such as text/plain
or application/json
. There are many third-part