vispy / jupyter_rfb

Remote Frame Buffer for Jupyter
https://jupyter-rfb.readthedocs.io
MIT License
55 stars 10 forks source link

Cannot run vispy examples: "Error: Module jupyter_rfb, version ^0.1.0 is not registered, however, 0.4.3 is" #89

Closed sanjayankur31 closed 1 month ago

sanjayankur31 commented 1 month ago

I was looking at running a few of the vispy examples in a jupyter lab instance. However, I can't get any of them to work:

image

Devtools show:

image

The messages are:

Error: Module jupyter_rfb, version ^0.1.0 is not registered, however,         0.4.3 is
    loadClass http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.fe2572ece3b7955c89bb.js?v=fe2572ece3b7955c89bb:1
    loadModelClass http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1
    _make_model http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1
    new_model http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1
    handle_comm_open http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1
    _handleCommOpen http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.fe2572ece3b7955c89bb.js?v=fe2572ece3b7955c89bb:1
    _handleCommOpen http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    _handleMessage http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    _msgChain http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    promise callback*19883/b/this._onWSMessage http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    _createSocket http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    setTimeout handler*_reconnect http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    reconnect http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    restart http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    restartKernel http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    restart http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    execute http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    execute http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    m http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    o http://localhost:8888/static/lab/jlab_core.7f4f9f24c6ff497f974f.js?v=7f4f9f24c6ff497f974f:2
    qe http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    Je http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    en http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    Yr http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    Xr http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    tl http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    Ae http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    We http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    tl http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    ft http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    ct http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    unstable_runWithPriority http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    ha http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    Fe http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
    it http://localhost:8888/static/lab/3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
gloo_molecular_viewer.ipynb:12714:25

I'd initially not pinned jupyterlab to any particular version, and had got the same result with version 4.x. I saw this comment on pinning jupyterlab to v3, so I did that.

This is a brand new virtual environment now:

$ python --version
Python 3.12.3

$ pip list
Package                   Version
------------------------- --------------
aiofiles                  22.1.0
aiosqlite                 0.20.0
airspeed                  0.6.0
anyio                     4.3.0
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.3.0
asttokens                 2.4.1
attrs                     23.2.0
Babel                     2.15.0
beautifulsoup4            4.12.3
bleach                    6.1.0
blosc2                    2.6.2
cachetools                5.3.3
cattrs                    23.2.3
certifi                   2024.2.2
cffi                      1.16.0
charset-normalizer        3.3.2
comm                      0.2.2
contourpy                 1.2.1
cycler                    0.12.1
debugpy                   1.8.1
decorator                 5.1.1
defusedxml                0.7.1
dill                      0.3.8
dnspython                 2.6.1
docstring_parser          0.16
entrypoints               0.4
executing                 2.0.1
fastjsonschema            2.19.1
fonttools                 4.51.0
fqdn                      1.5.1
freetype-py               2.4.0
graphviz                  0.20.3
h5py                      3.11.0
hsluv                     5.0.4
idna                      3.7
ipykernel                 6.29.4
ipython                   8.24.0
ipython-genutils          0.2.0
ipywidgets                8.1.2
isoduration               20.11.0
jedi                      0.19.1
Jinja2                    3.1.4
json5                     0.9.25
jsonpointer               2.4
jsonschema                4.22.0
jsonschema-specifications 2023.12.1
jupyter_client            7.4.9
jupyter_core              5.7.2
jupyter-events            0.10.0
jupyter-rfb               0.4.3
jupyter_server            2.14.0
jupyter_server_fileid     0.9.2
jupyter_server_terminals  0.5.3
jupyter_server_ydoc       0.8.0
jupyter-ydoc              0.2.5
jupyterlab                3.6.7
jupyterlab_pygments       0.3.0
jupyterlab_server         2.27.1
jupyterlab_widgets        3.0.10
kiwisolver                1.4.5
libNeuroML                0.5.8
lxml                      5.2.2
MarkupSafe                2.1.5
matplotlib                3.8.4
matplotlib-inline         0.1.7
matplotlib-scalebar       0.8.1
mistune                   3.0.2
modelspec                 0.3.4
mpmath                    1.3.0
msgpack                   1.0.8
natsort                   8.4.0
nbclassic                 1.0.0
nbclient                  0.10.0
nbconvert                 7.16.4
nbformat                  5.10.4
ndindex                   1.8
nest-asyncio              1.6.0
networkx                  3.3
neuromllite               0.5.9
notebook                  6.5.7
notebook_shim             0.2.4
numexpr                   2.10.0
numpy                     1.26.4
overrides                 7.7.0
packaging                 24.0
pandocfilters             1.5.1
parso                     0.8.4
pexpect                   4.9.0
pillow                    10.3.0
pip                       24.0
platformdirs              4.2.1
ppft                      1.7.6.8
progressbar2              4.4.2
prometheus_client         0.20.0
prompt-toolkit            3.0.43
psutil                    5.9.8
ptyprocess                0.7.0
pure-eval                 0.2.2
py-cpuinfo                9.0.0
pycparser                 2.22
Pygments                  2.18.0
PyLEMS                    0.6.7
pymongo                   4.7.2
pyNeuroML                 1.2.12
PyOpenGL                  3.1.7
PyOpenGL-accelerate       3.1.7
pyparsing                 3.1.2
python-dateutil           2.9.0.post0
python-json-logger        2.0.7
python-utils              3.8.2
PyYAML                    6.0.1
pyzmq                     26.0.3
referencing               0.35.1
requests                  2.31.0
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rpds-py                   0.18.1
scipy                     1.13.0
Send2Trash                1.8.3
six                       1.16.0
sniffio                   1.3.1
soupsieve                 2.5
stack-data                0.6.3
sympy                     1.12
tables                    3.9.2
tabulate                  0.9.0
terminado                 0.18.1
tinycss2                  1.3.0
tornado                   6.4
traitlets                 5.14.3
types-python-dateutil     2.9.0.20240316
typing_extensions         4.11.0
uri-template              1.3.0
urllib3                   2.2.1
vispy                     0.14.2
wcwidth                   0.2.13
webcolors                 1.13
webencodings              0.5.1
websocket-client          1.8.0
widgetsnbextension        4.0.10
y-py                      0.6.2
ypy-websocket             0.8.4

Any ideas on what to try? I've also tried py3.11 but get the same issue.

For context, we're using vispy for visualisations of neuronal models in NeuroML, and it'll be great if we can also have those working in jupyter lab instances/notebooks.

Cheers,

sanjayankur31 commented 1 month ago

Oh, and I did run jupyter lab from the new virtual env, the same one where jupyter_rfb is installed. So there shouldn't be any conflicts etc.

djhoese commented 1 month ago

@almarklein What is the current advice for installing jupyter_rgb on modern jupyterlab?

almarklein commented 1 month ago

I did recently change the version in package.json: https://github.com/vispy/jupyter_rfb/blob/e4cfbaf2d1debf6b34de13b6e0b2a8f862f5103c/js/package.json#L1-L3

It had been stuck at 0.1.0. I figured that it'd be better to also bump this number, but now I'm not sure. My knowledge of jupyter notebook/lab is limited. Is there anyone who understands versioning of jupyter plugins that can shed some light on this? @kushalkolar perhaps?

kushalkolar commented 1 month ago

I can reproduce the author's js error with jupyter_rfb v0.4.3.

With jupyterlab v4.2.0 and juptyer_rfb v0.4.2 everything works.

This is probably part of the culprit? :laughing:

https://github.com/vispy/jupyter_rfb/blob/e4cfbaf2d1debf6b34de13b6e0b2a8f862f5103c/js/lib/widget.js#L30-L31

I thought of doing a PR, but I think I want to search if there's a way to single-source versions for widgets before that.

almarklein commented 1 month ago

Ok, so the latest release of jupter_rfb is broken. I apologize for any inconveniences!

But I'm curious to why. Is it better practice to not bump that version? Should I have bumped something else somewhere?

kushalkolar commented 1 month ago

I think that if the package isn't going to be published to npm the version numbers inside js/ don't need to be updated as long as they match, but I'm not entirely sure.

almarklein commented 1 month ago

don't need to be updated

Apparently its even "should not be updated"? 😅

kushalkolar commented 1 month ago

Should probably yank this release, I've got more people asking me about this issue

almarklein commented 1 month ago

I made a new release, reverting the version change: 0.4.4

kushalkolar commented 1 month ago

v0.4.4 works on my end :D, jupyterlab v4.2