Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to register jupyter_bokeh #201

Open
obrown06 opened this issue Apr 11, 2024 · 11 comments
Open

Failed to register jupyter_bokeh #201

obrown06 opened this issue Apr 11, 2024 · 11 comments

Comments

@obrown06
Copy link

I'm trying to integrate a Tabulator into a Voila application as follows:

import pandas as pd
import panel as pn
pn.extension('tabulator')

df = pd.DataFrame(...)
df_widget = pn.ipywidget(pn.widgets.Tabulator(df))

I'm getting the following rendered error:

Failed to load model class 'BokehModel' from module '@bokeh/jupyter_bokeh'

And the following errors in the javascript console:

Plugin '@bokeh/jupyter_bokeh' failed to activate.
TypeError: No provider for: jupyter.extensions.jupyterWidgetRegistry.
Error: No version of module @bokeh/jupyter_bokeh is registered

The relevant package versions:

bokeh                     3.4.0
ipywidgets                8.1.2
jupyter                   1.0.0
jupyter_bokeh             4.0.1
jupyterlab                4.0.11
jupyterlab_widgets        3.0.10
panel                     1.4.1
python                    3.10.14

Anyone have an idea what might be going wrong here? Happy to redirect the query elsewhere if this isn't the right place. Thanks!

@bryevdv
Copy link
Member

bryevdv commented Apr 11, 2024

According to a Jupyter core dev

That indicates that the Jupyter widgets extension is not installed. Assuming your server is running jlab 3, it can be installed by installing ipywidgets 7.6+ or by installing jupyterlab_widgets 1.0+.

Is it possible you have an environment mixup and jupyterlab_widgets is not installed in the same environment you think it is?

Edit: But I guess that thread goes on to indicate that other scenarios can also cause this to happen. That's outside my expertise thought cc @philippjfr @mattpap

@obrown06
Copy link
Author

FWIW: I'm using Conda and it seems like jupyterlab_widgets is definitely installed:

conda list | grep jupyterlab_widgets
jupyterlab_widgets        3.0.10

@obrown06
Copy link
Author

Also, it looks like at least someone else may be hitting the same issue: https://community.deeplearning.ai/t/replicating-chatbot-implementation-with-huggingface-open-source-models/596117.

@Kalandoros
Copy link

Kalandoros commented May 26, 2024

I got the same issue. This is not new issue.
It's already persising for longer

jupyter_bokeh 4.0.4
jupyter_client 8.1.0
jupyter_core 5.3.0
jupyter-events 0.7.0
jupyter-lsp 2.2.0
jupyter_server 2.7.3
jupyter_server_terminals 0.4.4
jupyterlab 4.2.1
jupyterlab-pygments 0.2.2
jupyterlab_server 2.27.2
jupyterlab_widgets 3.0.10
panel 1.4.3
voila 0.5.7

labextensions:
@bokeh/jupyter_bokeh v4.0.4 enabled ok (python, jupyter_bokeh)
@pyviz/jupyterlab_pyviz v3.0.2 enabled ok

image

You may also have a look here: voila-dashboards/voila#1435
I am pretty sure that this is related. Unfortunately, due to a lack of knowledge, I am not in a position to make any further investigatens.

@MarcSkovMadsen
Copy link

MarcSkovMadsen commented Aug 6, 2024

+1. Me and my colleague have the same issue when trying to use Panel in VS Code interactive environment.

I can replicate in his environment with the following steps

python -m venv .venv
source .venv/bin/activate
pip install panel jupyter_bokeh ipykernel

Open the Jupyter Interactive environment

Run

import panel as pn

pn.extension()
pn.panel("Hello World")

image

When I click Click to show javascript error I see

Failed to load model class 'BokehModel' from module '@bokeh/jupyter_bokeh'
Error: No version of module @bokeh/jupyter_bokeh is registered

Versions

os: linux
python extension: v2024.4.1
jupyter extension: v2023.3.100

package versions
asttokens==2.4.1
bleach==6.1.0
bokeh==3.4.3
certifi==2024.7.4
charset-normalizer==3.3.2
comm==0.2.2
contourpy==1.2.1
debugpy==1.8.5
decorator==5.1.1
executing==2.0.1
idna==3.7
ipykernel==6.29.5
ipython==8.26.0
ipywidgets==8.1.3
jedi==0.19.1
Jinja2==3.1.4
jupyter_bokeh==4.0.5
jupyter_client==8.6.2
jupyter_core==5.7.2
jupyterlab_widgets==3.0.11
linkify-it-py==2.0.3
Markdown==3.6
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib-inline==0.1.7
mdit-py-plugins==0.4.1
mdurl==0.1.2
nest-asyncio==1.6.0
numpy==2.0.1
packaging==24.1
pandas==2.2.2
panel==1.4.5
param==2.1.1
parso==0.8.4
pexpect==4.9.0
pillow==10.4.0
platformdirs==4.2.2
prompt_toolkit==3.0.47
psutil==6.0.0
ptyprocess==0.7.0
pure_eval==0.2.3
Pygments==2.18.0
python-dateutil==2.9.0.post0
pytz==2024.1
pyviz_comms==3.0.3
PyYAML==6.0.1
pyzmq==26.1.0
requests==2.32.3
six==1.16.0
stack-data==0.6.3
tornado==6.4.1
tqdm==4.66.5
traitlets==5.14.3
typing_extensions==4.12.2
tzdata==2024.1
uc-micro-py==1.0.3
urllib3==2.2.2
wcwidth==0.2.13
webencodings==0.5.1
widgetsnbextension==4.0.11
xyzservices==2024.6.0
code-server: v4.23.1
Code: 1.88.1
Commit: 9a28bc29dbddb6886dfe03dc1c31320249a901ce
Date: 2024-04-15T23:01:57.805Z (3 mos ago)
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0

@MarcSkovMadsen
Copy link

MarcSkovMadsen commented Aug 6, 2024

I have managed to get this working in one case. What is below

  • Made sure I have the latest versions of Python and Jupyter Extension. I had to upgrade Jupyter extension.
  • Installed the kernel of my python environment: python -m ipykernel install --user --name myenv --display-name "Python (myenv)". Created and run the notebook in jupyterlab inspired by a stackoverflow response
  • Opened VS Code (Code Server) in my browser instead of a standalone PWA app. Ran the code. For some reason it here asked me to install Jupyter Notebook Renderers. I installed the renderer.

After each step I tried. Only after the last step it fully worked.

I will try to find a receipe that will work from scratch

@MarcSkovMadsen
Copy link

MarcSkovMadsen commented Aug 6, 2024

In another JupyterHub I see the below in my browser console

Error: Unable to read file 'vscode-remote://MY.DOMAIN/vscode-resource?{"requestResourcePath":"/home/jovyan/.local/share/code-server/extensions/ms-toolsai.jupyter-2024.3.1-universal/temp/scripts/af7cfb460b26abe4dbd921151f82f0407a7a48377d4530dbeb78bbfab664c42b/jupyter/@bokeh/jupyter_bokeh.js"}' (Error: Unable to resolve nonexistent file 'vscode-remote://mnr-jupyterhub.de-prod.dk/vscode-resource?{"requestResourcePath":"/home/jovyan/.local/share/code-server/extensions/ms-toolsai.jupyter-2024.3.1-universal/temp/scripts/af7cfb460b26abe4dbd921151f82f0407a7a48377d4530dbeb78bbfab664c42b/jupyter/@bokeh/jupyter_bokeh.js"}')
    at n.F (fileService.ts:631:10)
    at n.D (fileService.ts:616:15)
    at async v (resourceLoading.ts:68:18)
    at async M.yb (webviewElement.ts:743:19)

I don't believe the path MY.DOMAIN/vscode-resource is valid. I.e. there is some proxy issue.

@bryevdv
Copy link
Member

bryevdv commented Aug 6, 2024

cc @philippjfr for any thoughts

@MarcSkovMadsen
Copy link

MarcSkovMadsen commented Aug 6, 2024

I was not able to use steps above to find solution on the other JupyterHub.

@contang0
Copy link

panel version 1.4.5 does not have this issue. I installed the latest version, and running pn.extension() triggers the following error:

Unable to find widget '@bokeh/jupyter_bokeh' version '^4.0.5' from configured widget sources ["jsdelivr.com","unpkg.com"]. Expected behavior may be affected. Click here for more information.
Sources

Downgraded to 1.4.5 and the error is gone.

@philippjfr
Copy link
Contributor

Sorry, missed this entirely. Will have to do some digging because 4.0.5 definitely does exist on npm:

https://www.npmjs.com/package/@bokeh/jupyter_bokeh?activeTab=versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants