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

ipywidgets stuck at "Loading widget..." in JupyterLab #2623

Closed
christasich opened this issue Nov 21, 2019 · 25 comments
Closed

ipywidgets stuck at "Loading widget..." in JupyterLab #2623

christasich opened this issue Nov 21, 2019 · 25 comments
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@christasich
Copy link

I've been dealing with this problem the past few days. I've scoured past issues and tried all of the different solutions, but none of them have worked for me. I'm running JupyterLab on a remote server running Ubuntu Server 18.04 which I connect to through local port forwarding using Chrome.

import ipywidgets as widgets
widgets.IntSlider()

Results in "Loading widget..." without actually displaying the widget.

image

When I inspect the chrome console I see a number of errors like this.

image

I've tried using my default pip environment and an anaconda environment. Both have resulted in the same thing. When I run the code as an ipynb in standard Jupyter, I am able to see the widget. Any advice here?

Relevant info:
Remote Server: Ubuntu Server 18.04
Local: Windows 10 using Chrome
jupyter core: 4.6.1
jupyter notebook: 6.0.2
jupyter lab: 1.2.3
ipywidgets: 7.5.1
nodejs: 8.10.0

@christasich christasich changed the title ipywidgets stuck at "Loading widget..." ipywidgets stuck at "Loading widget..." in JupyterLab Nov 21, 2019
@jasongrout
Copy link
Member

What ipywidgets jlab extension do you have installed? jupyter labextension list

@jasongrout jasongrout added this to the Reference milestone Nov 21, 2019
@christasich
Copy link
Author

I knew I was missing one.

@jupyter-widgets/jupyterlab-manager v1.1.0

@jasongrout
Copy link
Member

That's what you have installed? Or you were missing it and now it works great?

@jasongrout
Copy link
Member

"jupyter.widget not found in registry" indicates that the jlab extension did not get set up correctly.

@christasich
Copy link
Author

That's what I have. It still doesn't work. I've followed that document you referenced before.

@christasich
Copy link
Author

image

@jasongrout
Copy link
Member

I would concentrate on making sure the jlab extension is installed and working properly. What other extensions do you have installed? Can you uninstall it, jupyter lab clean, and jupyter labextension install it again? Are you sure that this is the version of jlab that you are running?

@christasich
Copy link
Author

I've tried doing that a few times as well. I did it again and included the console output below. Do you see anything off?

image

I'm still having the same loading issue.

@jasongrout
Copy link
Member

That looks okay to me. Are there any other js errors before the ones you posted here that give an indication as to why it isn't loading properly?

@christasich
Copy link
Author

This is everything in the Chrome console. This happens on two different PCs that I've been using to connect to the remote server in case that helps.

image

@christasich
Copy link
Author

The same issue occurs in both Firefox and Edge.

@jasongrout
Copy link
Member

The next thing I would do is use the browser debugger to put a breakpoint in the js source for the widget extension to make sure it was loading.

Just curious - if you create a completely fresh environment with just lab and widgets installed, does it work?

@christasich
Copy link
Author

Just curious - if you create a completely fresh environment with just lab and widgets installed, does it work?

I just tried this with the same result.

The next thing I would do is use the browser debugger to put a breakpoint in the js source for the widget extension to make sure it was loading.

Where exactly should I put the breakpoint and how will I know if it loads? I'm not too familiar with the js source. I'm assuming it's in here somewhere.

image

@christasich
Copy link
Author

christasich commented Nov 27, 2019

For what it's worth, I tried installing Jupyter Lab and widgets on two other machines (all through Anaconda) and it results is the same. Here are the steps I've followed to install.

  1. Install Anaconda 2019.10
  2. Install Jupyter Lab, ipywidgets, nodejs
conda activate base
conda install -c conda-forge jupyterlab ipywidgets nodejs
  1. Install Jupyter Lab Extension jupyter labextension install @jupyter-widgets/jupyterlab-manager
  2. Open Jupyter Lab jupyter lab
  3. Within my browser, open a Python3 console and run
import ipywidgets as widget
widget.IntSlider()

This results in "Loading widget..." and the js errors above for all machines that I've tested. Have I missed something in my installation method?

@lckr
Copy link

lckr commented Jan 26, 2020

I experience the same issue using a fresh conda environment using

jupyterlab = 1.2.5
ipywidgets = 7.5.1
 @jupyter-widgets/jupyterlab-manager = 1.1.0 

Same behavior when using an older version of jupyterlab:

jupyterlab = 1.0.2
ipywidgets = 7.5.1
 @jupyter-widgets/jupyterlab-manager = 1.0.3 

@xiedidan
Copy link

I got the same issue with jlab:

ipywidgets                7.5.1                      py_0    conda-forge
jupyter_client            5.3.4                    py37_1    conda-forge
jupyter_core              4.6.1                    py37_0    conda-forge
jupyterlab                1.2.6                      py_0    conda-forge
jupyterlab_server         1.0.6                      py_0    conda-forge
nodejs                    11.14.0              he1b5a44_1    conda-forge
notebook                  6.0.3                    py37_0    conda-forge
(base) xd@xd-ubuntu:~$ jupyter labextension list
JupyterLab v1.2.6
Known labextensions:
   app dir: /home/xd/anaconda3/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v1.1.0  enabled  OK
        jupyter-matplotlib v0.5.0  enabled  OK

Uninstalled core extensions:
    @jupyter-widgets/jupyterlab-manager
    ipyvolume
    jupyter-matplotlib

These Uninstalled core extensions appears to be created by GUI extension manager. I don't know how to completely remove them, even with reinstalling jupyter.

@christasich
Copy link
Author

I'm still experiencing the same problem. @jasongrout anything we can provide that would be helpful?

@jasongrout
Copy link
Member

Within my browser, open a Python3 console and run

Ah, that's the issue. The console doesn't support widgets, just the notebook.

@jasongrout
Copy link
Member

So two questions come up for me:

  1. That's a pretty unhelpful message. What is happening is that there is a global widget rendermime that immediately says things are loading, and later on the widget manager gets connected to the kernel and for that specific activity and starts rendering widgets for real. The console will get that global rendermime renderer. What it should do is, after a short time, go ahead and render the text version, or some sort of message saying the widgets are not supported in that activity. Or perhaps we don't need to wait if we know we are in a console.
  2. Alternatively (or rather, in addition), the console really should support widgets. There's no real reason it can't, someone just has to expose the widget manager to the console.

If you (or anyone else) would like to help in these things, we can help you get started.

@christasich
Copy link
Author

Within my browser, open a Python3 console and run

Ah, that's the issue. The console doesn't support widgets, just the notebook.

Ahhh...that was it. I put it all into a notebook and I can see the widgets properly.

2. Alternatively (or rather, in addition), the console really should support widgets. There's no real reason it can't, someone just has to expose the widget manager to the console.

What would this require? I don't have a whole lot of time. I'm in the last year of my Ph.D. so I'm a bit limited in what I can do, but I'd be happy to help provide information if someone else wants to take the lead.

@xiedidan
Copy link

I switched to notebook and widgets are ok now.
But in jupyter lab widgets still don't work.
I'm not using console.

@jasongrout
Copy link
Member

jasongrout commented Jan 29, 2020

@christasich - I'll open issues for the two questions I raised above. Glad we got to the bottom of this issue you raised!

@xiedidan - this issue is about widgets not working in the console. Can you open another issue, since apparently it is a different problem? From your comment above, it seems it is related to the jlab widgets extension being uninstalled?

@jasongrout
Copy link
Member

We are already discussing ipywidgets support for the jlab code console at #2370.

@flobrec
Copy link

flobrec commented Apr 21, 2020

Just to confirm I have the same issue, not working in jupyter lab but working in notebook

@lock lock bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Jun 24, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

5 participants