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

Failing in notebook #1359

Closed
5 of 6 tasks
grburgess opened this issue Aug 25, 2022 · 7 comments · Fixed by #1361
Closed
5 of 6 tasks

Failing in notebook #1359

grburgess opened this issue Aug 25, 2022 · 7 comments · Fixed by #1361
Assignees
Labels
duplicate 🗐 Seen it before p2-bug-warning ⚠ Visual output bad submodule-notebook 📓 Much web such IDE
Projects

Comments

@grburgess
Copy link

  • 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:
4.64.0 3.10.6 (main, Aug 11 2022, 13:36:31) [Clang 13.1.6 (clang-1316.0.21.2.5)] darwin

Upon switching to an Apple M1 chip, I have been unable to get the progress bars to work in the notebook.
It is possible I have not installed something correctly.

JupyterLab configuration:

JupyterLab v3.4.5
Other labextensions (built into JupyterLab)
   app dir: /opt/homebrew/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/share/jupyter/lab
        @aquirdturtle/collapsible_headings v3.0.0 enabled OK
        @jlab-enhanced/cell-toolbar v3.5.1 enabled OK
        @jupyter-widgets/jupyterlab-manager v5.0.2 enabled OK
        @timkpaine/jupyterlab_miami_nights v0.3.1 enabled OK
        @yudai-nkt/jupyterlab_city-lights-theme v3.0.0 enabled OK
        js v0.1.0 enabled OK
        jupyter-matplotlib v0.11.2 enabled OK
        jupyterlab-code-snippets v2.1.0 enabled OK
        jupyterlab-jupytext v1.3.8 enabled OK
        jupyterlab-theme-hale v0.1.3 enabled OK

While everything works fine in the shell, when I run something in the notebookI get this:

from tqdm.notebook import tqdm

for i in tqdm(range(10)):
    
    pass
root:
    n: 0
    total: 10
    elapsed: 0.021565914154052734
    ncols: null
    nrows: 84
    prefix: ""
    ascii: false
    unit: "it"
    unit_scale: false
    rate: null
    bar_format: null
    postfix: null
    unit_divisor: 1000
    initial: 0
    colour: null
@teristam
Copy link

I have the same error and I am just on a Windows machine. I am also on Jupyterlab 3.4.5

@tarrade
Copy link

tarrade commented Aug 26, 2022

same error on Ubuntu 20.04 also using Jupyterlab 3.4.5 and recent packages.

@parashardhapola
Copy link

parashardhapola commented Aug 26, 2022

Same issue on Ubuntu 20.04.3 LTS. The problem is due to the latest version of ipywidgets (8.0.1). tqdm works as expected with ipywidgets==7.7.2.

This might be useful to dig deeper:
jupyter-widgets/ipywidgets#3455

@grburgess grburgess changed the title Failing in notebook possibly related to Apple M1 Failing in notebook Aug 27, 2022
@lukasbindreiter
Copy link

Apparently with the new version of ipywidgets the _repr_json_ method of TqdmHBox is favored instead of the widget display (https://github.com/tqdm/tqdm/blob/master/tqdm/notebook.py#L79)

So a temporary workaround is to replace TqdmHBox with a version that just doesn't have _repr_json_. Executing this cell fixes the issue for the current ipython session.

# hack: execute this cell to fix tqdm progress bar
from ipywidgets import HBox
import tqdm.notebook

class TqdmHBox(HBox):
    def __repr__(self, pretty=False):
        pbar = getattr(self, 'pbar', None)
        if pbar is None:
            return super(TqdmHBox, self).__repr__()
        return pbar.format_meter(**pbar.format_dict)

tqdm.notebook.TqdmHBox = TqdmHBox

@casperdcl
Copy link
Sponsor Member

Happy to re-open if different.

@casperdcl casperdcl closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2022
@casperdcl casperdcl added duplicate 🗐 Seen it before p2-bug-warning ⚠ Visual output bad submodule-notebook 📓 Much web such IDE labels Aug 30, 2022
@casperdcl casperdcl self-assigned this Aug 30, 2022
@casperdcl casperdcl added this to Done in Casper Aug 30, 2022
casperdcl added a commit that referenced this issue Aug 30, 2022
- fixes #1310
- fixes #1359
- fixes #1360
@jasonkhadka
Copy link

I still have the problem on jupyter notebook with tqdm-4.64.1 and ipywidgets-8.0.4.
The problem goes away if I reinstall ipywidgets-7.0.0. So, I do not think is issue is resolved at the moment.
@casperdcl

@alexnkorovin
Copy link

alexnkorovin commented Apr 14, 2023

from tqdm.notebook import tqdm
for i in tqdm(range(10):
pass

Led to error in output: Error displaying widget: model not found
import "from tqdm import tqdm" worked but as error print.

Downgrading helped:
ipywidgets 8.0.6-pyhd8ed1ab_0 --> 7.7.5-pyhd8ed1ab_0
jupyterlab_widgets 3.0.7-pyhd8ed1ab_0 --> 1.1.4-pyhd8ed1ab_0
widgetsnbextension 4.0.7-pyhd8ed1ab_0 --> 3.6.4-pyhd8ed1ab_0

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

Successfully merging a pull request may close this issue.

8 participants