✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Issue with using Plotly and FigureWidget in JupyterLab

A few months ago, I built a Docker image to allow me to run experiments with JupyterLab and Plotly. I use FigureWidgets extensibly to build mini-dashboards (VBox, etc).

Today I had to rebuild the docker image as I modified one of the early lines in the DockerFile.
Since then, every attempt to plot a FigureWidget returns an Error displaying widget: model not found error.

I followed the Getting Started to update to the latest version of the extensions, and now my docker file contains:

ENV NODE_OPTIONS=--max-old-space-size=4096 
RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.1 --no-build \
    && jupyter labextension install plotlywidget@1.5.4 --no-build \
    && jupyter labextension install jupyterlab-plotly@1.5.4 --no-build \
    && jupyter labextension install @aquirdturtle/collapsible_headings --no-build \
    && jupyter labextension install @jupyterlab/toc --no-build \
    && jupyter labextension install jupyterlab-python-file --no-build \
    && jupyter lab build

When checking extensions within jupyterlab, here’s what I’m getting:

JupyterLab v1.2.0
Known labextensions:
   app dir: /usr/local/share/jupyter/lab
        @aquirdturtle/collapsible_headings v0.5.0  enabled  OK
        @jupyter-widgets/jupyterlab-manager v1.1.0  enabled  OK
        @jupyterlab/toc v2.0.0  enabled  OK
        jupyterlab-plotly v1.5.4  enabled  OK
        jupyterlab-python-file v0.3.0  enabled  OK
        plotlywidget v1.5.4  enabled  OK

However, whilst I can use the go.Figure() function fine, using go.FigureWidget() still returns that same error.

Unfortunately, as stated above, I cannot swap my code from FigureWidget, as I use the Widget functionality a lot to add sub-plots and to do vertical boxing

Hi @Wabiloo welcome to the forum! Which version of plotly do you use? The extensions versions are specific to one release of plotly.py and the ones given in the README on github correspond to the most recent version.

Ah, yes, sorry. I forgot part of the DockerFile:

I’m using v4.5.4, as per the Getting Started instructions:

RUN pip install plotly==4.5.4 jupyterlab==1.2 "ipywidgets>=7.5"
# RUN pip install chart-studio 

ENV NODE_OPTIONS=--max-old-space-size=4096 
RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.1 --no-build \
    && jupyter labextension install jupyterlab-plotly@1.5.4 --no-build \
    && jupyter labextension install plotlywidget@1.5.4 --no-build \
    && jupyter labextension install @aquirdturtle/collapsible_headings --no-build \
    && jupyter labextension install @jupyterlab/toc --no-build \
    && jupyter labextension install jupyterlab-python-file --no-build \
    && jupyter lab build

Hum it seems that you matched versions correctly indeed. Maybe some on the suggestions in Error Displaying FigureWidget can help?

also just for debugging could you try also in a fresh pip or conda environment (not with a docker container)?