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

Problems with tqdm.auto #71

Closed
EingeoelterBolt opened this issue Mar 2, 2023 · 2 comments · Fixed by #70
Closed

Problems with tqdm.auto #71

EingeoelterBolt opened this issue Mar 2, 2023 · 2 comments · Fixed by #70
Assignees
Labels
enhancement New feature or request

Comments

@EingeoelterBolt
Copy link

Hi, thank you very much for developing this awesome library. I really like it because of its easy use and the option to utilize tqdm with nearly no overhead for the developer.

Currently, when I code with jupyter notebook, I have to work on different devices, os and using ssh. I was wondering, why sometimes on some configurations the tqdm bar didn't show up or I got empty output cells or I got an error due to javascript widget missing. It could be that I found the problem for my types of problems.

It seems like, that tqdm.auto import is not optimal or the frontend sometimes fails to distinguish between the run on the terminal and in a jupyter notebook (see tqdm/tqdm#1098 (comment)). My current workaround for these types of problems, which seems currently to work, is to change the import in the "progress_bar.py" file : "from tqdm.auto import tqdm" to just "from tqdm import tqdm". The progressbar is now not shiny and pretty, but it seems like, that it gurantes to work on any setup described before.

If you don't want to change the import, maybe you can outsource this decision as a parameter on the method call something like "notebook=True" or at least write it to the documentation. It would be really sad, if users want to use your great library because of the support of tqdm and uninstall it again, because the progess bar doesn't show up.

@sybrenjansen
Copy link
Owner

Hmm. That's a good point.

I could add a progress_bar_backend parameter which you can then set to default or notebook (maybe adding 'rich' on a later point in time). The default can then be overridden globally, but is set to the standard tqdm on startup.

This does indeed mean that people won't get a shiny widget by default, but I guess that's better than sometimes having no progress bar at all.

@sybrenjansen
Copy link
Owner

Released in v2.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants