Is upgrading prebuilt extensions possible? necessary?

I’m trying to get my versions in line with this chart for jupyter-matplotlib, but my labextension list is

JupyterLab v3.2.5
...
/usr/local/share/jupyter/labextensions
        jupyter-matplotlib v0.8.2 enabled OK
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/share/jupyter/lab
        @jupyterlab/git v0.34.0 enabled OK


The following source extensions are overshadowed by older prebuilt extensions:
    jupyter-matplotlib

The last line likely the result of trying jupyter labextension update jupyter-matplotlib. Is there a better way to do this?

Right, says right on the tin If you are using JupyterLab 1 or 2,.

Try pip install --upgrade --ignore-installed ipympl, though you may have to do some more below. Specifically in that case, you really want the backend and frontend to agree on key things, and managing that dependency matching manually is a mug’s game, and a huge motivator for the prebuilt extension system.

For JupyterLab 3 you should be able to:

  • rely on pip or conda to put stuff in $PREFIX/share/labextensions
  • never have to type jupyter labextension install or update,
    • unless you are…
      • building an extension, and want to make sure that works for others who are…
      • packaging a tailored, shared distribution of JupyterLab for e.g. your organization, and are…
        • trying to save every little byte or…
        • compiling in a special dependency or…
      • required to do so by an extension that does not Just Work in JupyterLab 3 after pip install (or equivalent)

If you aren’t in any above category, I’d highly recommend a jupyter lab clean --help and choose how clean you want it… or, a but more primitively, just delete the $PREFIX/share/jupyter/lab/static folder (preserving your settings, etc), and it will fall back to using the “gold master” assets shipped in your site-packages.

2 Likes

Ah. pip install ipympl was installing the right version, but my jupyter paths were all screwed up and reading a zombie data directory from an old installation. I fixed it with a symlink, which I am sure is horrible, but for another day.

1 Like