jupyter-widget-stixview icon indicating copy to clipboard operation
jupyter-widget-stixview copied to clipboard

Javascript Error: No version of module jupyter-widget-stixview is registered

Open danieleperera opened this issue 2 years ago • 0 comments

Hi everyone,

I'm encountering an issue after when trying to view the strix2 graph. I've tried to install the widget inside jupyter notebook:

FROM jupyter/minimal-notebook:latest

# Change USER
USER root

# Upgrade to the latest version
RUN pip install --upgrade jupyterlab

# Install necessary Linux packages
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        wkhtmltopdf \
        texlive-xetex \
        texlive-fonts-recommended \
        texlive-latex-recommended \
        texlive-latex-extra \
        pandoc \
    && apt-get clean && rm -rf /var/lib/apt/lists/*


# Install additional requirements
COPY ./requirements.txt /tmp/requirements.txt

# Install custom Python packages using pip
RUN pip install -r /tmp/requirements.txt && \
    rm -rf /home/$NB_USER/.cache/pip

RUN jupyter nbextension enable --py --sys-prefix jupyter_widget_stixview

# Change USER
USER $NB_UID
# requirements.txt
jupyter_widget_stixview

I'm getting the following error:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'StixviewGraphModel' from module 'jupyter-widget-stixview'
Error: No version of module jupyter-widget-stixview is registered
    at f.loadClass (http://127.0.0.1:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.a63a8d293fb35a52dc25.js?v=a63a8d293fb35a52dc25:1:74936)
    at f.loadModelClass (http://127.0.0.1:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.ebc7a55ea1768712771f.js?v=ebc7a55ea1768712771f:1:10729)
    at f._make_model (http://127.0.0.1:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.ebc7a55ea1768712771f.js?v=ebc7a55ea1768712771f:1:7517)
    at f.new_model (http://127.0.0.1:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.ebc7a55ea1768712771f.js?v=ebc7a55ea1768712771f:1:5137)
    at f.handle_comm_open (http://127.0.0.1:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.ebc7a55ea1768712771f.js?v=ebc7a55ea1768712771f:1:3894)
    at _handleCommOpen (http://127.0.0.1:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.a63a8d293fb35a52dc25.js?v=a63a8d293fb35a52dc25:1:73473)
    at b._handleCommOpen (http://127.0.0.1:8888/static/lab/jlab_core.c3f88431949a8243d08c.js?v=c3f88431949a8243d08c:2:1040031)
    at async b._handleMessage (http://127.0.0.1:8888/static/lab/jlab_core.c3f88431949a8243d08c.js?v=c3f88431949a8243d08c:2:1042021)

The code i'm running is:

from jupyter_widget_stixview.widget import StixviewGraph

# Rendering the graph from data in python

bundle_data = { ... }

StixviewGraph(
    bundle=bundle_data,
    properties={
        "graphHeight": 400,
        "caption": "Custom STIX2 bundle"
    })

Any support is highly appreciated.

danieleperera avatar Oct 20 '23 08:10 danieleperera