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
Use tqdm for Jupyter Notebooks #580
Comments
Can someone pretty please fix this? It makes tqdm worse than worthless. |
No problem here with tqdm in Jupyter notebooks; do you reproduce this issue with very simple workflows, as in https://tsfresh.readthedocs.io/en/latest/text/quick_start.html ? |
It's an old issue with tqdm on jupyter . see here : tqdm/tqdm#375 Workaround is to clear tqdm instance with
whenever it occurs. |
Different workarounds have been suggested in this issue; il looks like main tqdm developer advocates importing |
The problem I have with the ImportError: IntProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html as we are note requiring ipywidgets. |
This is a common enough problem that it seems like it should ‘just work’ in both a console and a Jupyter Notebook. People don’t always know the context in which their code will be run and requiring every library to determine its execution context and use a different API seems an enormous duplication of effort that could be done once by making the default method for tqdm work in both console and Jupyter. Am I right? |
I am closing this issue as it has nothing to do with tsfresh, but is an upstream issue for tqdm (where it was addressed or at least discussed already). |
@nils-braun this breaks your library on the most popular platform where it is used. This attitude is unfortunate and impacts many (most?) users of the library. |
What about detecting the environment where tsfresh is run and use the respective Bar? See also https://stackoverflow.com/questions/15411967/how-can-i-check-if-code-is-executed-in-the-ipython-notebook |
@rjurney sorry did not want to be rude! :-) I thought it is a problem in the tqdm library (and if we can fix it there much more people can benefit from this) - but of course we can also do a workaround in tsfresh (which will obviously not fix the root cause). Do you already have a solution in mind and are you willing to do a PR with it? We are always happy for contributors! |
fixed in Also if you can't use |
btw @nils-braun the expected behaviour is: from tqdm import tqdm # plain-text version; relies on `\r`
from tqdm.notebook import tqdm # notebook version; relies on `ipywidgets`
from tqdm.autonotebook import tqdm # auto-detect frontend, printing warning
from tqdm.auto import tqdm # auto-detect frontend, not printing warning so basically |
@casperdcl Thanks for the very nice update and thanks for reporting it here :-) NameError: name 'IProgress' is not defined and the error handling of that will fail in ImportError: FloatProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html I guess this is expected (from looking at your code you are trying out different combinations of |
Hmm. I'm not sure about the case of running in a notebook sans |
@casperdcl I guess it depends on what message you want to communicate: is tqdm well tested and well working in CLI mode even in notebooks (e.g. no bugs like the one described here) or do you assume that notebooks work best with the widgets? |
Both :) |
When using tsfresh in Jupyter Notebook, output from tqdm results bar is not overwriting itself but creating a line for every change in percentage. Can we somehow build a switch for using tqdm_notebook?
The text was updated successfully, but these errors were encountered: