Skip to content

tqdm_notebook fails with IPython 3 #187

@QuLogic

Description

@QuLogic

Running something simple like:

import tqdm
for i in tqdm.tqdm_notebook(range(1000000)):
    i * 2

produces this traceback:

NameError                                 Traceback (most recent call last)
<ipython-input-6-207cef0f8cd2> in <module>()
      1 import tqdm
----> 2 for i in tqdm.tqdm_notebook(range(1000000)):
      3     i * 2

~/.local/lib/python3.4/site-packages/tqdm/__init__.py in tqdm_notebook(*args, **kwargs)
     17     """See tqdm._tqdm_notebook.tqdm_notebook for full documentation"""
     18     from ._tqdm_notebook import tqdm_notebook as _tqdm_notebook
---> 19     return _tqdm_notebook(*args, **kwargs)
     20 
     21 

~/.local/lib/python3.4/site-packages/tqdm/_tqdm_notebook.py in __init__(self, *args, **kwargs)
    182         # self.sp('', close=True)
    183         # Replace with IPython progress bar display (with correct total)
--> 184         self.sp = self.status_printer(self.fp, self.total, self.desc)
    185         self.desc = None  # trick to place description before the bar
    186 

~/.local/lib/python3.4/site-packages/tqdm/_tqdm_notebook.py in status_printer(file, total, desc)
    103         # Prepare IPython progress bar
    104         if total:
--> 105             pbar = IntProgress(min=0, max=total)
    106         else:  # No total? Show info style bar with no progress tqdm status
    107             pbar = IntProgress(min=0, max=1)

NameError: name 'IntProgress' is not defined

using 4.7.4-a581bbd.

The conditional imports seem a bit confused about versions. The comments in the first block say ipywidgets is IPython 4.x, and IPython.html.widgets is 3.x/2.x, but the second block always imports from ipywidgets.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions