ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 21 Jul 2023 14:31:10 +0200tqdm in jupyter doesn't work correctlyhttps://ask.sagemath.org/question/70209/tqdm-in-jupyter-doesnt-work-correctly/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?Sun, 16 Jul 2023 07:28:15 +0200https://ask.sagemath.org/question/70209/tqdm-in-jupyter-doesnt-work-correctly/Answer by micsthepick for <p>I've run the following to install tqdm:</p>
<pre><code>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
</code></pre>
<p>and tested it with the following cell code:</p>
<pre><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)
</code></pre>
<p>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?</p>
https://ask.sagemath.org/question/70209/tqdm-in-jupyter-doesnt-work-correctly/?answer=70415#post-id-70415For 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 sagemathTue, 18 Jul 2023 01:01:46 +0200https://ask.sagemath.org/question/70209/tqdm-in-jupyter-doesnt-work-correctly/?answer=70415#post-id-70415Comment by slelievre for <p>For whatever reason the following got sagemath to work fine with tqdm (I had only recently installed sagemath, so I was fine with reinstalling):</p>
<pre><code>sudo apt remove sagemath --purge
rm -r ~/.sage/
sudo apt install sagemath
</code></pre>
https://ask.sagemath.org/question/70209/tqdm-in-jupyter-doesnt-work-correctly/?comment=70607#post-id-70607Congratulations. You can accept your own answer to mark your question as solved.Fri, 21 Jul 2023 14:31:10 +0200https://ask.sagemath.org/question/70209/tqdm-in-jupyter-doesnt-work-correctly/?comment=70607#post-id-70607