Problems with Tabulator widget in VS Code Jupyter notebook


First, thanks for such an amazing piece of software!

I have some strange behaviour while was using Tabulator in Jupyter inside VS Code.

It’s basically a slightly modified example from the reference guide to demonstrate this:

> test.ipynb

# %% Cell 1
import datetime as dt
import numpy as np
import pandas as pd
import panel as pn


sel_df = pd.DataFrame(np.random.randn(5, 5), columns=list('ABCDE'))
select_table = pn.widgets.Tabulator(sel_df)

# %% Cell 2

In VS Code, the second cell is empty even if I select something.

Instead, if I open it via: jupyter notebook test.ipynb, it works as expected.

Both are using the same conda environment.

Could you suggest how to fix this? I suspect it’s some conflict with VS Code extensions.


It works for me. Two things I would suggest you try:

  1. Confirm you have the lastest panel installed (1.0.4)
  2. Install jupyter_bokeh=3.0.7 (Develop in other notebook environments — Panel v1.0.4)

(If you get a BokehUserWarning: reference already known, just ignore it)

Hi, unfortunately, it is what I have right now:

conda list | grep 'panel\|bokeh'

bokeh                3.1.1           py310h2f386ee_0  
jupyter_bokeh        3.0.7           py310h5eee18b_0  
panel                1.0.4                    pypi_0    pypi

Works for me.

Could you select a few rows, and check the output of the second cell?

Actually the selection does not work for me either. I would not expect select_table.selected_dataframe to update dynamically. Its not a parameter or documented attribute.

I would expect selected_table.param.selection to update dynamically though but it does not.

panel==1.04 bokeh==3.1.1 ipywidgets-bokeh==1.4.0 jupyter-bokeh==3.0.7

Does that work for you @Hoxbro ?

Actually, it was a feature that I was looking for :slight_smile:
Interestingly, in normal Jupyter via browser it works like this

1 Like

Does that work for you @Hoxbro?

The problem is that technically VS Code notebooks and Jupyter Notebooks work differently. So they need different “communication” supported by Panel.

Doesn’t work for me either in VS Code, but works in Jupyter.

I just tried on my laptop (above was using codeserver on a JupyterHub). And locally on windows laptop it works for me.

panel==1.0.4 bokeh==3.1.1 jupyter-bokeh==3.0.7

One thing you could check @VoRodin is whether your VS Code Python and Jupyter extensions are up to date?

I just checked on my local setup on my personal laptop and it works. :+1:

Before I have been using the installation on a remote cluster (lxplus) as well.
This cluster has some conflicts with VS Code in general.