Skip to content

run tqdm in jupyter show TypeError: function() argument 1 must be code, not str #1135

@lk1983823

Description

@lk1983823

When I run from tqdm.auto import tqdm in a new jupyter notebook? , it shows errors:
TypeError: function() argument 1 must be code, not str.
This is error is related to tqdm (4.58.0). But I dont know how to cope with it.
However, it runs ok using vscode.
Thanks!

TypeError                                 Traceback (most recent call last)
<ipython-input-1-0d43b139d341> in <module>
----> 1 from tqdm.auto import tqdm

~/.pyenv/versions/anaconda3-5.0.1/envs/p36env/lib/python3.6/site-packages/tqdm/auto.py in <module>
     20 with warnings.catch_warnings():
     21     warnings.simplefilter("ignore", category=TqdmExperimentalWarning)
---> 22     from .autonotebook import tqdm as notebook_tqdm
     23     from .autonotebook import trange as notebook_trange
     24 

~/.pyenv/versions/anaconda3-5.0.1/envs/p36env/lib/python3.6/site-packages/tqdm/autonotebook.py in <module>
     21     from warnings import warn
     22 
---> 23     from .notebook import tqdm, trange
     24     from .std import TqdmExperimentalWarning
     25     warn("Using `tqdm.autonotebook.tqdm` in notebook mode."

~/.pyenv/versions/anaconda3-5.0.1/envs/p36env/lib/python3.6/site-packages/tqdm/notebook.py in <module>
     78 
     79 
---> 80 class TqdmHBox(HBox):
     81     """`ipywidgets.HBox` with a pretty representation"""
     82     def _repr_json_(self, pretty=None):

TypeError: function() argument 1 must be code, not str

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions