Ask Your Question
1

tqdm in jupyter doesn't work correctly

asked 1 year ago

micsthepick gravatar image

I've run the following to install tqdm:

sage --pip install --user tqdm
sage --pip install ipywidgets
sage --jupyter nbextension enable --py widgetsnbextension
sage --pip install --upgrade ipywidgets
sage --pip install --upgrade widgetsnbextension
sage --pip install --upgrade jupyterlab
sudo sage --jupyter nbextension enable --py widgetsnbextension --sys-prefix

and tested it with the following cell code:

from sage.all import Integer
from tqdm.notebook import tqdm

SAMPLE_COUNT = 100r  # replace with your actual sample count

with tqdm(total=int(SAMPLE_COUNT)) as progress:
    for i in range(SAMPLE_COUNT):
        progress.update(1r)
        sleep(0.1r)

it seems to load fine, but the progressbar never updates, and it also looks to be in text form, instead of the widget with pretty colours?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 1 year ago

micsthepick gravatar image

updated 1 year ago

For whatever reason the following got sagemath to work fine with tqdm (I had only recently installed sagemath, so I was fine with reinstalling):

sudo apt remove sagemath --purge
rm -r ~/.sage/
sudo apt install sagemath
Preview: (hide)
link

Comments

Congratulations. You can accept your own answer to mark your question as solved.

slelievre gravatar imageslelievre ( 1 year ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 1 year ago

Seen: 1,185 times

Last updated: Jul 18 '23