tqdm NameError: global name 'HTML' is not defined

Viewed 1752

I'm learning to use tqdm. I made a very simple test case but met with NameError. The test case is as follows:

from tqdm import tqdm_notebook

num = 100
bar = tqdm_notebook(total=num)

The file name is b.py and I run:

python b.py

The error happened and the error message is:

Traceback (most recent call last):
  File "b.py", line 4, in <module>
    bar = tqdm_notebook(total=num)
  File "/usr/local/lib/python2.7/dist-packages/tqdm/__init__.py", line 19, in tqdm_notebook
    return _tqdm_notebook(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tqdm/_tqdm_notebook.py", line 183, in __init__
    self.sp = self.status_printer(self.fp, self.total, self.desc)
  File "/usr/local/lib/python2.7/dist-packages/tqdm/_tqdm_notebook.py", line 104, in status_printer
    ptext = HTML()
NameError: global name 'HTML' is not defined

I thought it was because I did not install a package named HTML, so that I run

sudo pip install HTML

It did installed an HTML package. But the error remained the same when I run the test case again.

What's wrong with this example? Did I miss other packages? Thank you all for helping me!

0 Answers
Related