jupyterlab-dash icon indicating copy to clipboard operation
jupyterlab-dash copied to clipboard

Unable to communicate with the jupyterlab-dash JupyterLab extension.

Open sangeetsaurabh opened this issue 5 years ago • 22 comments

Hi there,

When I am trying to run Dash in Jupyter Notebook, I am getting following error -

Exception in thread Thread-105: Traceback (most recent call last): File "/Users/ssaurabh/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/Users/ssaurabh/anaconda3/lib/python3.7/threading.py", line 1158, in run self.function(*self.args, **self.kwargs) File "/Users/ssaurabh/anaconda3/lib/python3.7/site-packages/jupyterlab_dash/init.py", line 71, in _perform_show """) OSError: Unable to communicate with the jupyterlab-dash JupyterLab extension. Is this Python kernel running inside JupyterLab with the jupyterlab-dash extension installed?

You can install the extension with:

$ jupyter labextension install jupyterlab-dash

Any idea how I need to run my Python Kernel?

Thanks, Sangeet

sangeetsaurabh avatar Apr 14 '19 01:04 sangeetsaurabh

the same question here.

ghost avatar May 09 '19 00:05 ghost

@sangeetsaurabh can you provide some more details about how you are running your jupyterlab (you say jupyter notebook in your post, but this is a jupyterlab extension) notebook (e.g locally with windows, deployed with jupyterhub, etc.)?

zmays avatar Jun 03 '19 15:06 zmays

I'm seeing this as well. In my case, my notebook server is launched from a hub and is running lab. I've confirmed that the dash extension is installed and enabled.

I copy/pasted the "Usage" example from the README and the code ran without error, however nothing in the UI changed. The exception was displayed a few seconds after viewer.show(app) was executed.

ryanlovett avatar Jul 15 '19 17:07 ryanlovett

I have the same issue - I believe it is related to Jupyterhub specifically. When I run jupyterlab from jupyterhub I get the issue, but when I connect to it via port-forwarding on the same server it works fine.

csinva avatar Jul 15 '19 18:07 csinva

same here.

fluentlydata avatar Jul 17 '19 14:07 fluentlydata

I was able to get jupyterlab-dash working on one computer but then hit the same OSError exception listed above when running on a second computer.

I also was getting the following in juptyerlab's output:

[IPKernelApp] WARNING | No such comm: 2a809ee5a5634c858534436ee8973b27
Exception ignored in: <function Comm.__del__ at 0x7fe5a20099d8>
Traceback (most recent call last):
  File "/home/jonathan/.pyenv/versions/3.7.2/envs/jupyterlab-3.7.2/lib/python3.7/site-packages/ipykernel/comm/comm.py", line 76, in __del__
  File "/home/jonathan/.pyenv/versions/3.7.2/envs/jupyterlab-3.7.2/lib/python3.7/site-packages/ipykernel/comm/comm.py", line 116, in close
  File "/home/jonathan/.pyenv/versions/3.7.2/envs/jupyterlab-3.7.2/lib/python3.7/site-packages/ipykernel/comm/manager.py", line 56, in unregister_comm
KeyError: ('2a809ee5a5634c858534436ee8973b27',)

I'm sure this won't work for everyone, but in my case upgrading ipykernel (to 7.7.0 from 7.6.1) fixed things. Thanks!

p.s. I was coming across this issue in a straightforward single user jupyterlab setup (i.e. not running jupyterhub)

hottwaj avatar Aug 07 '19 10:08 hottwaj

Chiming in on this --

I get the error each time I reconnect to the notebook instance. I have to shut down my server, re-activate the plugin, and then re-start the server. Then it works again

billgreenwald avatar Sep 03 '19 21:09 billgreenwald

@billgreenwald What do you mean by "re-activate the plugin". How do you do that? Does it mean rebuild ?

raghavendrajain avatar Nov 11 '19 04:11 raghavendrajain

Each time I wanted to use the extension, I would first re-run

jupyter labextension install [email protected]

And then it would work until I closed the notebook.

However, I reinstalled conda for a different reason, and now it won't work at all. So I don't think my solution was actually anything.

billgreenwald avatar Nov 11 '19 05:11 billgreenwald

@billgreenwald Thanks for the prompt response! Actually, I could solve the problem and it is working well. I did the Development Installation. Just followed the steps and everything works smoothly. BTW, I did not use conda command for installation. All sort of installation related to Dash was done using pip, even though I am running it inside conda's base environment.

EDIT: The link to the Development Installation is https://github.com/plotly/jupyterlab-dash#development-installation

raghavendrajain avatar Nov 11 '19 05:11 raghavendrajain

I tried @raghavendrajain's suggestion and it worked, for anyone in the future trying things

billgreenwald avatar Nov 21 '19 05:11 billgreenwald

@sangeetsaurabh Can you please try the solution @billgreenwald and myself tried and if successful, please close the issue. Thank you!

raghavendrajain avatar Nov 22 '19 00:11 raghavendrajain

Tried doing a development build following instructions as @billgreenwald and @raghavendrajain suggested from within my Python 3.6.9 virtual environment.

But still get the error.

Here are my libs from a pip list:

dash (1.8.0)
dash-core-components (1.7.0)
dash-html-components (1.0.2)
dash-renderer (1.2.3)
dash-table (4.6.0)
jupyter (1.0.0)
jupyter-client (5.3.4)
jupyter-console (6.1.0)
jupyter-core (4.6.1)
jupyter-server-proxy (1.2.0)
jupyterlab (1.2.5)
jupyterlab-dash (0.1.0a3, /home/jconlon/git/jup-eds/jupyterlab-dash)
jupyterlab-server (1.0.6)

jconlon avatar Jan 23 '20 21:01 jconlon

Have you tried upgrading ipython & ipykernel (if not already up to date)?

hottwaj avatar Jan 24 '20 11:01 hottwaj

Here are my ipython versions, I believe they are the latest...

ipykernel (5.1.3)
ipython (7.11.1)
ipython-genutils (0.2.0)
ipywidgets (7.5.1)

jconlon avatar Jan 24 '20 21:01 jconlon

@jconlon Hi. Please tell me your OS? I will share my experience a bit more. When I open jupyter lab and run the sample code given in this link, I must add that this does not always work. I have to refresh the Extensions a couple of times and reload it. Please try all that. Sorry, my help is not really methodical but this extension does not seem to work that smoothly. However, I did get immense benefit from using it, the speed of prototyping was faster.

raghavendrajain avatar Jan 27 '20 04:01 raghavendrajain

Hi @raghavendrajain

Here is my OS:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic

I too was trying the simple Usage example, but I always get that error. Now I am inside of a env, at is from that terminal that I start the jupyter notebook like: (.venv) jconlon@mudshark:~/git/jup-eds$ jupyter notebook

jconlon avatar Jan 29 '20 02:01 jconlon

@jconlon I believe you should not use command jupyter notebook but should use jupyter lab to start a notebook from your terminal. The extension belongs to the jupyterlab, as the name suggests.

raghavendrajain avatar Jan 29 '20 03:01 raghavendrajain

Hi @raghavendrajain

Right, I/O error on my part. Its working now.

thanks!

jconlon avatar Jan 29 '20 04:01 jconlon

I was running Dash applications in JupyterLab yesterday, but when I restarted JupyterLab today, I ran into this issue. Reinstalling jupyterlab-dash didn't help. I tried development installation as well, since @raghavendrajain and @billgreenwald reported it as a working solution. However, the installation fails when building jupyterlab assets (webpack fails with Error: Cannot find module 'jupyterlab-dash/package.json'). Any ideas?

mhavu avatar Apr 08 '20 16:04 mhavu

Hi @mhavu It happens with me too sometime. I first restart the kernel and usually it works. I never had to go for re-installation.

raghavendrajain avatar Apr 09 '20 03:04 raghavendrajain

To add to the discussion,

The issue mentioned by OP occurs for me when i run the python data science notebook image in docker and run jupyter lab in the docker container and then try to install the jupyter lab dash extension.

zain910128 avatar Apr 11 '20 14:04 zain910128