Repository: holoviz/holoviews

Issue:
Interactive Graphs Don't Update in VSCode
#### ALL (relevant) software version info
#### Python packages
holoviews: 1.12.7 
jupyter: 1.0.0           
jupyter_client: 7.3.4             
jupyter_console: 6.6.3             
jupyter_core: 5.3.0            
jupyter_server: 1.23.6            
jupyterlab_pygments: 0.2.2              
jupyterlab_widgets: 3.0.7      
numpy: 1.20.2       

#### Visual Studio Code related info
Version: 1.78.1 (user setup)
Commit: 6a995c4f4cc2ced6e3237749973982e751cb0bf9
Date: 2023-05-04T09:48:08.683Z
Electron: 22.5.1
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22000
Sandboxed: Yes
        

#### Description of expected behavior and the observed behavior
Based on the documentation, when the value of the slider changes, the graph's output should also change. However, in VSCode, this is not the case. I have observed this with multiple graphs and the issue does not seem limited to sliders. Any help would be greatly appreciated!

#### Complete, minimal, self-contained example code that reproduces the issue

```
import numpy as np
import holoviews as hv

## Set extension
hv.extension('bokeh')

## Create a sine curve, same code from the DynamicMap documentation
def sine_curve(phase, freq):
    xvals = [0.1* i for i in range(100)]
    return hv.Curve((xvals, [np.sin(phase+freq*x) for x in xvals]))
dmap = hv.DynamicMap(sine_curve, kdims=['phase', 'frequency'])
dmap.redim.range(phase=(0.5,1), frequency=(0.5,1.25))

```

#### Screenshots or screencasts of the bug in action
![image](https://github.com/holoviz/holoviews/assets/96392206/7125af61-09b8-4215-a882-db8b4717ca45)
![image](https://github.com/holoviz/holoviews/assets/96392206/5bd6676d-d23e-414c-813c-c942274159f5)



Discussion:
You are using a _really_ old version of Holoviews (and, by the looks of it, also other packages). Try updating to the latest versions from a fresh environment.

(The latest holoviews version is 1.16.2)
One of the issues here is likely the [pinning of an older HoloViews version](https://github.com/denisecailab/minian/blob/master/environment.yml). Regardless, I also recommend trying the latest HoloViews.
Thank you for the quick response! I created a new environment and only included relevant packages including jupyter, holoviews/bokeh, and numpy. The issue still persists:

![image](https://github.com/holoviz/holoviews/assets/96392206/4f28f9e3-5cf0-4a81-8b5c-195cfdbf967e)
![image](https://github.com/holoviz/holoviews/assets/96392206/005815a2-1dec-430f-958e-2d63e0c6084f)

What version of holoviews did you download? If it is 1.16.1, try: `hv.extension('bokeh', inline=False)`. 
#### Package versions
bokeh: 3.1.1
holoviews: 1.16.2

Setting ```hv.extension('bokeh', inline=False)``` did not resolve the issue either.
Can you try to install jupyter_bokeh=3.0.7? 

If that does not work, can you give me the full package list of your environment with `pip list` or `conda list`?
Sadly installing jupyter_bokeh=3.0.7 didn't fix the issue either. Here is my full environment:

#### All packages
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             5.1                       1_gnu  
aiofiles                  22.1.0          py311h06a4308_0  
aiosqlite                 0.18.0          py311h06a4308_0  
anyio                     3.5.0           py311h06a4308_0  
argon2-cffi               21.3.0             pyhd3eb1b0_0  
argon2-cffi-bindings      21.2.0          py311h5eee18b_0  
asttokens                 2.0.5              pyhd3eb1b0_0  
attrs                     22.1.0          py311h06a4308_0  
babel                     2.11.0          py311h06a4308_0  
backcall                  0.2.0              pyhd3eb1b0_0  
beautifulsoup4            4.12.2          py311h06a4308_0  
blas                      1.0                         mkl  
bleach                    4.1.0              pyhd3eb1b0_0  
bokeh                     3.1.1           py311h92b7b1e_0  
bottleneck                1.3.5           py311hbed6279_0  
brotli                    1.0.9                h5eee18b_7  
brotli-bin                1.0.9                h5eee18b_7  
brotlipy                  0.7.0           py311h5eee18b_1002  
bzip2                     1.0.8                h7b6447c_0  
ca-certificates           2023.05.30           h06a4308_0  
certifi                   2023.5.7        py311h06a4308_0  
cffi                      1.15.1          py311h5eee18b_3  
charset-normalizer        2.0.4              pyhd3eb1b0_0  
colorcet                  3.0.1                      py_0    pyviz
comm                      0.1.2           py311h06a4308_0  
contourpy                 1.0.5           py311hdb19cb5_0  
cryptography              39.0.1          py311h9ce1e76_0  
cycler                    0.11.0             pyhd3eb1b0_0  
dbus                      1.13.18              hb2f20db_0  
debugpy                   1.5.1           py311h6a678d5_0  
decorator                 5.1.1              pyhd3eb1b0_0  
defusedxml                0.7.1              pyhd3eb1b0_0  
entrypoints               0.4             py311h06a4308_0  
executing                 0.8.3              pyhd3eb1b0_0  
expat                     2.4.9                h6a678d5_0  
fontconfig                2.14.1               h4c34cd2_2  
fonttools                 4.25.0             pyhd3eb1b0_0  
freetype                  2.12.1               h4a9f257_0  
giflib                    5.2.1                h5eee18b_3  
glib                      2.69.1               he621ea3_2  
gst-plugins-base          1.14.1               h6a678d5_1  
gstreamer                 1.14.1               h5eee18b_1  
holoviews                 1.16.2                     py_0    pyviz
icu                       58.2                 he6710b0_3  
idna                      3.4             py311h06a4308_0  
intel-openmp              2023.1.0         hdb19cb5_46305  
ipykernel                 6.19.2          py311h6410fe4_0  
ipython                   8.12.0          py311h06a4308_0  
ipython_genutils          0.2.0              pyhd3eb1b0_1  
ipywidgets                8.0.4           py311h06a4308_0  
jedi                      0.18.1          py311h06a4308_1  
jinja2                    3.1.2           py311h06a4308_0  
jpeg                      9e                   h5eee18b_1  
json5                     0.9.6              pyhd3eb1b0_0  
jsonschema                4.17.3          py311h06a4308_0  
jupyter                   1.0.0           py311h06a4308_8  
jupyter_bokeh             3.0.7           py311h5eee18b_0  
jupyter_client            8.1.0           py311h06a4308_0  
jupyter_console           6.6.3           py311h06a4308_0  
jupyter_core              5.3.0           py311h06a4308_0  
jupyter_events            0.6.3           py311h06a4308_0  
jupyter_server            2.5.0           py311h06a4308_0  
jupyter_server_fileid     0.9.0           py311h06a4308_0  
jupyter_server_terminals  0.4.4           py311h06a4308_0  
jupyter_server_ydoc       0.8.0           py311h06a4308_0  
jupyter_ydoc              0.2.4           py311h06a4308_0  
jupyterlab                3.6.3           py311h06a4308_0  
jupyterlab_pygments       0.1.2                      py_0  
jupyterlab_server         2.22.0          py311h06a4308_0  
jupyterlab_widgets        3.0.5           py311h06a4308_0  
kiwisolver                1.4.4           py311h6a678d5_0  
krb5                      1.19.4               h568e23c_0  
lcms2                     2.12                 h3be6417_0  
ld_impl_linux-64          2.38                 h1181459_1  
lerc                      3.0                  h295c915_0  
libbrotlicommon           1.0.9                h5eee18b_7  
libbrotlidec              1.0.9                h5eee18b_7  
libbrotlienc              1.0.9                h5eee18b_7  
libclang                  14.0.6          default_hc6dbbc7_1  
libclang13                14.0.6          default_he11475f_1  
libdeflate                1.17                 h5eee18b_0  
libedit                   3.1.20221030         h5eee18b_0  
libevent                  2.1.12               h8f2d780_0  
libffi                    3.4.4                h6a678d5_0  
libgcc-ng                 11.2.0               h1234567_1  
libgomp                   11.2.0               h1234567_1  
libllvm14                 14.0.6               hdb19cb5_3  
libpng                    1.6.39               h5eee18b_0  
libpq                     12.9                 h16c4e8d_3  
libsodium                 1.0.18               h7b6447c_0  
libstdcxx-ng              11.2.0               h1234567_1  
libtiff                   4.5.0                h6a678d5_2  
libuuid                   1.41.5               h5eee18b_0  
libwebp                   1.2.4                h11a3e52_1  
libwebp-base              1.2.4                h5eee18b_1  
libxcb                    1.15                 h7f8727e_0  
libxkbcommon              1.0.1                h5eee18b_1  
libxml2                   2.10.3               hcbfbd50_0  
libxslt                   1.1.37               h2085143_0  
linkify-it-py             2.0.0           py311h06a4308_0  
lxml                      4.9.2           py311h5eee18b_0  
lz4-c                     1.9.4                h6a678d5_0  
markdown                  3.4.1           py311h06a4308_0  
markdown-it-py            2.2.0           py311h06a4308_1  
markupsafe                2.1.1           py311h5eee18b_0  
matplotlib                3.7.1           py311h06a4308_1  
matplotlib-base           3.7.1           py311ha02d727_1  
matplotlib-inline         0.1.6           py311h06a4308_0  
mdit-py-plugins           0.3.0           py311h06a4308_0  
mdurl                     0.1.0           py311h06a4308_0  
mistune                   0.8.4           py311h5eee18b_1000  
mkl                       2023.1.0         h6d00ec8_46342  
mkl-service               2.4.0           py311h5eee18b_1  
mkl_fft                   1.3.6           py311ha02d727_1  
mkl_random                1.2.2           py311ha02d727_1  
munkres                   1.1.4                      py_0  
nbclassic                 0.5.5           py311h06a4308_0  
nbclient                  0.5.13          py311h06a4308_0  
nbconvert                 6.5.4           py311h06a4308_0  
nbformat                  5.7.0           py311h06a4308_0  
ncurses                   6.4                  h6a678d5_0  
nest-asyncio              1.5.6           py311h06a4308_0  
notebook                  6.5.4           py311h06a4308_0  
notebook-shim             0.2.2           py311h06a4308_0  
nspr                      4.35                 h6a678d5_0  
nss                       3.89.1               h6a678d5_0  
numexpr                   2.8.4           py311h65dcdc2_1  
numpy                     1.24.3          py311h08b1b3b_1  
numpy-base                1.24.3          py311hf175353_1  
openssl                   1.1.1t               h7f8727e_0  
packaging                 23.0            py311h06a4308_0  
pandas                    1.5.3           py311hba01205_0  
pandocfilters             1.5.0              pyhd3eb1b0_0  
panel                     1.1.0                      py_0    pyviz
param                     1.13.0                     py_0    pyviz
parso                     0.8.3              pyhd3eb1b0_0  
pcre                      8.45                 h295c915_0  
pexpect                   4.8.0              pyhd3eb1b0_3  
pickleshare               0.7.5           pyhd3eb1b0_1003  
pillow                    9.4.0           py311h6a678d5_0  
pip                       23.0.1          py311h06a4308_0  
platformdirs              2.5.2           py311h06a4308_0  
ply                       3.11            py311h06a4308_0  
prometheus_client         0.14.1          py311h06a4308_0  
prompt-toolkit            3.0.36          py311h06a4308_0  
prompt_toolkit            3.0.36               hd3eb1b0_0  
psutil                    5.9.0           py311h5eee18b_0  
ptyprocess                0.7.0              pyhd3eb1b0_2  
pure_eval                 0.2.2              pyhd3eb1b0_0  
pycparser                 2.21               pyhd3eb1b0_0  
pyct                      0.5.0                      py_0    pyviz
pyct-core                 0.5.0                      py_0    pyviz
pygments                  2.15.1          py311h06a4308_1  
pyopenssl                 23.0.0          py311h06a4308_0  
pyparsing                 3.0.9           py311h06a4308_0  
pyqt                      5.15.7          py311h6a678d5_0  
pyqt5-sip                 12.11.0         py311h6a678d5_0  
pyrsistent                0.18.0          py311h5eee18b_0  
pysocks                   1.7.1           py311h06a4308_0  
python                    3.11.3               h7a1cb2a_0  
python-dateutil           2.8.2              pyhd3eb1b0_0  
python-fastjsonschema     2.16.2          py311h06a4308_0  
python-json-logger        2.0.7           py311h06a4308_0  
pytz                      2022.7          py311h06a4308_0  
pyviz_comms               2.3.0                      py_0    pyviz
pyyaml                    6.0             py311h5eee18b_1  
pyzmq                     25.0.2          py311h6a678d5_0  
qt-main                   5.15.2               h8373d8f_8  
qt-webengine              5.15.9               hbbf29b9_6  
qtconsole                 5.4.2           py311h06a4308_0  
qtpy                      2.2.0           py311h06a4308_0  
qtwebkit                  5.212                h3fafdc1_5  
readline                  8.2                  h5eee18b_0  
requests                  2.29.0          py311h06a4308_0  
rfc3339-validator         0.1.4           py311h06a4308_0  
rfc3986-validator         0.1.1           py311h06a4308_0  
send2trash                1.8.0              pyhd3eb1b0_1  
setuptools                67.8.0          py311h06a4308_0  
sip                       6.6.2           py311h6a678d5_0  
six                       1.16.0             pyhd3eb1b0_1  
sniffio                   1.2.0           py311h06a4308_1  
soupsieve                 2.4             py311h06a4308_0  
sqlite                    3.41.2               h5eee18b_0  
stack_data                0.2.0              pyhd3eb1b0_0  
tbb                       2021.8.0             hdb19cb5_0  
terminado                 0.17.1          py311h06a4308_0  
tinycss2                  1.2.1           py311h06a4308_0  
tk                        8.6.12               h1ccaba5_0  
toml                      0.10.2             pyhd3eb1b0_0  
tornado                   6.2             py311h5eee18b_0  
tqdm                      4.65.0          py311h92b7b1e_0  
traitlets                 5.7.1           py311h06a4308_0  
typing-extensions         4.5.0           py311h06a4308_0  
typing_extensions         4.5.0           py311h06a4308_0  
tzdata                    2023c                h04d1e81_0  
uc-micro-py               1.0.1           py311h06a4308_0  
urllib3                   1.26.16         py311h06a4308_0  
wcwidth                   0.2.5              pyhd3eb1b0_0  
webencodings              0.5.1           py311h06a4308_1  
websocket-client          0.58.0          py311h06a4308_4  
wheel                     0.38.4          py311h06a4308_0  
widgetsnbextension        4.0.5           py311h06a4308_0  
xyzservices               2022.9.0        py311h06a4308_1  
xz                        5.4.2                h5eee18b_0  
y-py                      0.5.9           py311h52d8a92_0  
yaml                      0.2.5                h7b6447c_0  
ypy-websocket             0.8.2           py311h06a4308_0  
zeromq                    4.3.4                h2531618_0  
zlib                      1.2.13               h5eee18b_0  
zstd                      1.5.5                hc292b87_0 
The example works in my VSCode, and I can't see any clear difference between your and mine environment.  

Can I get you to run `conda env export` of your environment?

Some suggestions which could work: 
- Create a new notebook and paste the example into to see if that will work.
- Create a new environment but add `conda-forge` to the channels. This should look something like this: `conda create -n cf_env "jupyter_bokeh=3.0.7" "jupyterlab<4" "holoviews=1.16" "panel=1" -c conda-forge` (Maybe with some more packages)


I think I discovered the problem, but I am unsure if it is solvable!

I did what you suggested and created a new environment using conda-forge, and this didn't work. However, I did this on a different computer, and the environment did work ("work" as in the interactivity was functional on this new computer). 

The key difference is that I have been using the SSH extension in VSCode to SSH into an analysis computer, and when I am SSHing into the analysis computer the interactivity is NOT functional in the .ipynb file in VSCode. I am guessing this is the issue? 

Thank you for all your help!


Resolving patch:
diff --git a/holoviews/util/__init__.py b/holoviews/util/__init__.py
--- a/holoviews/util/__init__.py
+++ b/holoviews/util/__init__.py
@@ -713,14 +713,11 @@ def __call__(self, *args, **params):
         import panel as pn
 
         if pn.config.comms == "default":
-            try:
-                import google.colab  # noqa
+            if "google.colab" in sys.modules:
                 pn.config.comms = "colab"
                 return
-            except ImportError:
-                pass
 
-            if "VSCODE_PID" in os.environ:
+            if "VSCODE_CWD" in os.environ or "VSCODE_PID" in os.environ:
                 pn.config.comms = "vscode"
                 self._ignore_bokeh_warnings()
                 return


Test patch: