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

jupyter lab: does not render progressbar #1310

Closed
5 of 6 tasks
wookayin opened this issue Mar 18, 2022 · 25 comments · Fixed by #1361 or #1366
Closed
5 of 6 tasks

jupyter lab: does not render progressbar #1310

wookayin opened this issue Mar 18, 2022 · 25 comments · Fixed by #1361 or #1366
Assignees
Labels
p2-bug-warning ⚠ Visual output bad submodule-notebook 📓 Much web such IDE to-fix ⌛ In progress
Projects

Comments

@wookayin
Copy link

wookayin commented Mar 18, 2022

  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
  • I have visited the source website, and in particular read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)
    
    4.63.0       3.9.7 | packaged by conda-forge          darwin

Bug

From some point in my environments, I was seeing tqdm.notebook renders like a JSON rather than a HTML widget or progress bar. It happens in a jupyter lab -- jupyter notebook is fine.

image

I suspect this is due to some combination of other plugins and extensions, but I cannot easily find why so that's why I file this issue to keep track of my troubleshooting.

Environment information:

tqdm 4.63.0
ipywidgets==8.0.0a
widgetsnbextension==4.0.0rc0

jupyter-client==7.1.2
jupyter-core==4.9.1
jupyter-lsp==1.5.1
jupyter-server==1.13.5
jupyterlab==3.3.2
jupyterlab-lsp==3.10.0
jupyterlab-pygments==0.1.2
jupyterlab-server==2.10.3
jupyterlab-widgets==3.0.0rc0


$ jupyter labextension list
JupyterLab v3.3.2
/Users/wookayin/.miniforge3/share/jupyter/labextensions
        @pyviz/jupyterlab_pyviz v2.1.0 enabled OK (python, pyviz_comms)
        @krassowski/jupyterlab-lsp v3.10.0 enabled OK (python, jupyterlab-lsp)
        @voila-dashboards/jupyterlab-preview v2.1.3 enabled OK (python, voila)
        @jupyter-widgets/jupyterlab-manager v5.0.0-rc.0 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /Users/wookayin/.miniforge3/share/jupyter/lab
@wookayin
Copy link
Author

I found that this is an issue of ipywidgets>=8.0.0.rc0. I will report an issue there.

@casperdcl
Copy link
Sponsor Member

@wookayin you mean there's some issue under https://github.com/jupyter-widgets/ipywidgets/issues?

@Hubbitus
Copy link

Sorry, is there some fix or workarounds?

@A-Telfer
Copy link

downgrading ipywidgets to below <8 didn't work for me

@wragge
Copy link

wragge commented Aug 22, 2022

Downgrading ipywidgets to 7.7.1 and jupyterlab-widgets to 1.1.1 worked for me.

@lqhuang
Copy link

lqhuang commented Aug 25, 2022

Downgrading ipywidgets to 7.7.1 and jupyterlab-widgets to 1.1.1 worked for me.

Yeah, just limit the version like this at current stage

jupyterlab_widgets<2.0.0
ipywidgets<8.0.0

@casperdcl casperdcl self-assigned this Aug 30, 2022
@casperdcl casperdcl added to-fix ⌛ In progress p2-bug-warning ⚠ Visual output bad submodule-notebook 📓 Much web such IDE labels Aug 30, 2022
@casperdcl casperdcl changed the title tqdm in jupyter notebook renders like a JSON jupyter lab: does not render progressbar Aug 30, 2022
@casperdcl casperdcl added this to Next Release in Casper Aug 30, 2022
@casperdcl
Copy link
Sponsor Member

jupyter notebook works fine (any version of ipywidgets & tqdm). I believe you mean jupyter lab is broken?

@casperdcl
Copy link
Sponsor Member

Does #1361 (pip install -U "git+https://github.com/tqdm/tqdm.git@fix-jupyterlab#egg=tqdm") work for you?

@i-aki-y
Copy link

i-aki-y commented Aug 31, 2022

Does #1361 (pip install -U "git+https://github.com/tqdm/tqdm.git@fix-jupyterlab#egg=tqdm") work for you?

Hi @casperdcl , it works for me!
With the following versions:

ipywidgets                8.0.1
jupyterlab                3.4.5
jupyterlab-widgets        3.0.2

@lqhuang
Copy link

lqhuang commented Aug 31, 2022

jupyter notebook works fine (any version of ipywidgets & tqdm). I believe you mean jupyter lab is broken?

Yes, my setup is under the jupyterlab. Seems you have solved. Thanks for your efforts!

@michaelaye
Copy link

pinning ipywidgets to <8 is becoming quite a constraint quickly. would be a pain to say goodbye to tqdm. :(

Casper automation moved this from Next Release to Done Sep 2, 2022
@casperdcl
Copy link
Sponsor Member

Should be fixed now in tqdm>=4.64.1

@postrou
Copy link

postrou commented Sep 5, 2022

Still have this issue.

tqdm==4.64.1
ipywidgets==8.0.2
jupyterlab-widgets==3.0.3

Rolling back ipywidgets helps.

@casperdcl
Copy link
Sponsor Member

casperdcl commented Sep 5, 2022

Those specs work for me. Are you sure you're connecting to the right (ipy)kernel?

@postrou
Copy link

postrou commented Sep 5, 2022

I use VS Code for jupyter notebooks, if it is important. Here is the screenshot

image

Whenever I run the cell with trange, jupyter gives me the following as output

info 22:3:17.614: Cell 1 executed with state Success
info 22:3:17.652: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 22:3:17.675: Widget Message: WidgetManager: Loading class ProgressStyleModel:@jupyter-widgets/controls:2.0.0
info 22:3:17.675: Widget Message: WidgetManager: Loading class FloatProgressModel:@jupyter-widgets/controls:2.0.0
info 22:3:17.675: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 22:3:17.680: Widget Message: Waiting for model to be available before rendering it 6cf19fa53cad44fea6d9f91514e87548
info 22:3:17.680: Widget Message: WidgetManager: Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
info 22:3:17.680: Widget Message: WidgetManager: failed, Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
info 22:3:17.680: Widget Message: WidgetManager: failed, Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
error 22:3:17.680: Widget load failure {} {
  className: 'HTMLStyleModel',
  moduleName: '@jupyter-widgets/controls',
  moduleVersion: '2.0.0',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: '{}'
}
info 22:3:17.681: Widget Message: WidgetManager: Loading class HTMLModel:@jupyter-widgets/controls:2.0.0
info 22:3:17.681: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 22:3:17.691: Widget Message: WidgetManager: Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
info 22:3:17.692: Widget Message: WidgetManager: failed, Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
info 22:3:17.695: Widget Message: WidgetManager: failed, Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
error 22:3:17.695: Widget load failure {} {
  className: 'HTMLStyleModel',
  moduleName: '@jupyter-widgets/controls',
  moduleVersion: '2.0.0',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: '{}'
}
info 22:3:17.696: Widget Message: WidgetManager: Loading class HTMLModel:@jupyter-widgets/controls:2.0.0
info 22:3:17.697: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 22:3:17.700: Widget Message: WidgetManager: Loading class HBoxModel:@jupyter-widgets/controls:2.0.0
info 22:3:17.705: Widget Message: Received display data message 6cf19fa53cad44fea6d9f91514e87548
info 22:3:17.705: Widget Message: Error: Failed to render widget 6cf19fa53cad44fea6d9f91514e87548, Error: Module @jupyter-widgets/controls, semver range ^2.0.0 is not registered as a widget module

@Jajiko
Copy link

Jajiko commented Sep 21, 2022

I also have problems with the same configuration as postrou.

tqdm==4.64.1
ipywidgets==8.0.2
jupyterlab-widgets==3.0.3

For me, nothing is displayed.
I tested in vanilla jupyter, not vscode.
Can it be a Windows-only problem? A friend did not have problems with these versions on Linux.

@specter119
Copy link

I also have problems with the same configuration as postrou.

tqdm==4.64.1
ipywidgets==8.0.2
jupyterlab-widgets==3.0.3

For me, nothing is displayed. I tested in vanilla jupyter, not vscode. Can it be a Windows-only problem? A friend did not have problems with these versions on Linux.

No, tqdm works as expected in the environment with following versions created by conda on windows 10:

ipywidgets                8.0.2              pyhd8ed1ab_1    conda-forge
jupyterlab_widgets        3.0.3              pyhd8ed1ab_0    conda-forge
tqdm                      4.64.1             pyhd8ed1ab_0    conda-forge

@Jajiko
Copy link

Jajiko commented Sep 21, 2022

Thanks for the reply. The ASCII version seems to work, but the notebook version does not:

image

What other dependencies could affect it?

@specter119
Copy link

@Jajiko seems you still use the legacy jupyter notebook.

image

@morrisalp
Copy link

I'm running in dockerized JupyterLab (v2.3.2). After upgrading to tqdm==4.64.1, notebook display shows this strange behavior:
Screen Shot 2022-11-27 at 21 48 10
with ASCII output and no updates. The ASCII bar works though:
Screen Shot 2022-11-27 at 21 49 02
Relevant versions:
Screen Shot 2022-11-27 at 21 50 22

@enzokro
Copy link

enzokro commented Dec 8, 2022

I'm running in dockerized JupyterLab (v2.3.2). After upgrading to tqdm==4.64.1, notebook display shows this strange behavior: Screen Shot 2022-11-27 at 21 48 10 with ASCII output and no updates. The ASCII bar works though: Screen Shot 2022-11-27 at 21 49 02 Relevant versions: Screen Shot 2022-11-27 at 21 50 22

Seeing the same issue, with the exact same package versions. It still happens even in a brand new environment even with careful re-installs.

Maybe it helps for debugging: but it seems tied to the state of the widgets and/or kernel. That would make sense if the issue is in some ~/.jupyter config or file, so it's more global than a specific env.

I haven't found a good way to "reset" or "rebuild" the widget state. Maybe that points in a promising direction?

@enzokro
Copy link

enzokro commented Dec 9, 2022

Hi all,

Was able to resolve this on my end, I hope it's helpful for others.

Basically, I had been using jupyter notebook for a while and recently switched to lab. There were a few stray notebook extensions, mainly matplotlib and js-widgets, still hanging around. I believe these caused my issues.

I completely uninstalled and removed those notebook extensions. Then, making sure that no server was running, I did a pip uninstall and pip reinstall --upgrade --ignore-installed --force-reinstall of the following libraries: jupyterlab, jupyterlab_widgets, ipywidgets.

Finally, a jupyter lab clean and jupyter lab build.

After the three steps above, the widgets are back! This might be more specific to my broken environment than the problem others are having, just posting in case it helps anyone.

@morrisalp
Copy link

morrisalp commented Feb 24, 2023

I finally found a solution! Based on the advice of @enzokro, I found that running the following two commands before launching Jupyter Lab makes the widgets appear properly:

pip install --upgrade --ignore-installed --force-reinstall jupyterlab_widgets
jupyter lab build

I didn't need to do any of the other steps @enzokro mentioned, this is enough to make it work for me.

Also note that if you put this in a Dockerfile RUN directive, you must run source /usr/local/nvm/nvm.sh before jupyter lab build because it assumes that Nodejs is in PATH (normally this is run via bashrc when running a bash session).

(see my post above for more info about my environment)

@PaulKGrimes
Copy link

This is still broken with:
tqdm 4.65.0
ipywidgets 8.0.6
jupyterlab_widgets 3.0.7

@sebnapi
Copy link

sebnapi commented Sep 2, 2023

Don't get any output with vanilla jupyter on MacOS:

import ipywidgets
import jupyterlab_widgets
import tqdm

print(ipywidgets.__version__, jupyterlab_widgets.__version__, tqdm.__version__)

8.1.0 3.0.8 4.66.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-bug-warning ⚠ Visual output bad submodule-notebook 📓 Much web such IDE to-fix ⌛ In progress
Projects
Casper
  
Done
Development

Successfully merging a pull request may close this issue.