Ipysheet in TLJH: "Failed to load model class 'SheetModel' from module 'ipysheet'"

Hi, I am trying to use ipysheet in a Jupyterlab notebook running in TLJH Version 3.6.1, with this instructions

from  ipysheet import sheet
sheet(rows=1,columns=4)

but I am getting a Javascript error:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'SheetModel' from module 'ipysheet'

This happens both using Jupyterlab and a classic Jupyter notebook.
The expected output is a table rendered this way:
image

I tried running the same code on a fresh local Miniconda install (no Jupyterhub), and after installing the ipysheet library, the same code has the expected output, both in Jupyterlab and in Classic Notebook interface.

I tried to downgrade the libraries in the conda virtual environment that I am using in TLJH to match the libraries in the Miniconda install, but the problem persists.

The libraries I am using in the TLJH server:

:~$ conda list | grep ipy
ipykernel                 6.19.2             pyh210e3f2_0    conda-forge
ipysheet                  0.7.0              pyhd8ed1ab_0    conda-forge
ipython                   8.10.0             pyh41d4057_0    conda-forge
ipywidgets                8.0.4              pyhd8ed1ab_0    conda-forge
:~$ conda list | grep jupy
jupyter_client            8.1.0              pyhd8ed1ab_0    conda-forge
jupyter_core              5.3.0           py311h38be061_0    conda-forge
jupyterlab_widgets        3.0.5              pyhd8ed1ab_0    conda-forge

The same versions are installed in the local Miniconda install. Both TLJH is running in a Ubuntu 20.04.5 LTS Docker container, while Miniconda is running directly on the machine hosting the container, that is a Ubuntu 22.04.1 LTS. The browser used is the same for both instances.

The issue looks similar to this issue with ipywidgets, but actually in my Jupyterhub instance ipywidgets work except for ipysheet, and the solution proposed there is to upgrade ipywidgets to 8.x.x, that doesn’t solve the problem for me (I already have ipywidgets 8.0.4).

Any ideas on how to solve this?

The full text of the error message is:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'SheetModel' from module 'ipysheet'
loadClass@http://0.0.0.0:12000/user/admin/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js?v=40eaa5b8e976096d50b2:1:74856
loadModelClass@http://0.0.0.0:12000/user/admin/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:10729
_make_model@http://0.0.0.0:12000/user/admin/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:7517
new_model@http://0.0.0.0:12000/user/admin/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:5137
handle_comm_open@http://0.0.0.0:12000/user/admin/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:3894
134/v/this._handleCommOpen@http://0.0.0.0:12000/user/admin/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js?v=40eaa5b8e976096d50b2:1:73393
_handleCommOpen@http://0.0.0.0:12000/user/admin/static/lab/jlab_core.3e11c5239452d671150c.js?v=3e11c5239452d671150c:2:1037310

I found a workaround for this problem:

the ipysheet widgets work when I install ipysheet in the base environment, before creating new conda virtual environments.

So, the bottom line is: widget libraries need to be installed in the base environment otherwise they also won’t work in any other environment.