VS Code Interactive is not rendering tqdm.notebook properly
Asked Answered
L

1

15

I used to use from tqdm.auto import tqdm and when I was in VS Code Interactive, I would get nice outputs of tqdm like so:

tqdm.notebook image

I setup a new environment with venv, and now I've lost that - only the text version works:

tqdm.auto import tqdm only works with text

When I run this sample cell:

from tqdm.auto import tqdm
import time
for i in tqdm(range(10)):
    time.sleep(.1)

I get nothing outputted:

no outputs :(

I noticed some errors in the jupyter logs:

info 13:23:28.399: Execute Cell 2 Interactive-1.interactive
info 13:23:28.476: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 13:23:28.525: Widget Message: WidgetManager: Loading class ProgressStyleModel:@jupyter-widgets/controls:2.0.0
info 13:23:28.526: Widget Message: WidgetManager: Loading class FloatProgressModel:@jupyter-widgets/controls:2.0.0
info 13:23:28.527: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 13:23:28.527: Widget Message: WidgetManager: Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
info 13:23:28.527: Widget Message: WidgetManager: failed, Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
info 13:23:28.527: Widget Message: WidgetManager: failed, Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
error 13:23:28.532: Widget load failure {} {
  className: 'HTMLStyleModel',
  moduleName: '@jupyter-widgets/controls',
  moduleVersion: '2.0.0',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: '{}'
}
info 13:23:28.534: Widget Message: WidgetManager: Loading class HTMLModel:@jupyter-widgets/controls:2.0.0
info 13:23:28.534: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 13:23:28.534: Widget Message: WidgetManager: Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
info 13:23:28.534: Widget Message: WidgetManager: failed, Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
info 13:23:28.534: Widget Message: WidgetManager: failed, Loading class HTMLStyleModel:@jupyter-widgets/controls:2.0.0
error 13:23:28.534: Widget load failure {} {
  className: 'HTMLStyleModel',
  moduleName: '@jupyter-widgets/controls',
  moduleVersion: '2.0.0',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: '{}'
}
info 13:23:28.535: Widget Message: WidgetManager: Loading class HTMLModel:@jupyter-widgets/controls:2.0.0
info 13:23:28.536: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:2.0.0
info 13:23:28.542: Widget Message: WidgetManager: Loading class HBoxModel:@jupyter-widgets/controls:2.0.0
info 13:23:29.464: Cell 2 executed with state Success
Lethalethal answered 18/8, 2022 at 17:26 Comment(1)
Looks like this is an issue with the newest release - 8.0.0Lethalethal
D
21

I think your assumption is correct. After I downgraded ipywidgets to 7.7.1, tqdm.notebook works fine.

Draught answered 19/8, 2022 at 2:15 Comment(4)
Confirming this is indeed one solution.Proem
Downgrading also worked for me with: conda install -c conda-forge ipywidgets==7.7.1Forked
Thanks. I also tested this inside a venv using pip uninstall ipywidgets and then pip install ipywidgets==7.7.2. It worked for me too.Onomatopoeia
Had the same issue... came to the same SO post (from myself none-the-less). Still not fixed as of 8.0.4.Lethalethal

© 2022 - 2024 — McMap. All rights reserved.