无法在笔记本中使用tqdm_notebook

13

当我在迭代中使用 tqdm_notebook

from tqdm import tqdm_notebook as tqdm

它只显示:

HBox(children=(IntProgress(value=1, bar_style='info', max=1), HTML(value='')))

我该怎么做?

2个回答

11

可能您没有安装ipywidgets。

对于Jupyter Notebook,您可以使用以下命令检查: $ jupyter nbextension list

对于Jupyter Lab,您可以使用以下命令检查: $ jupyter labextension list

安装ipywidgets的过程在这里有描述。


8
安装页面不是很清楚。在JupyterLab中,运行“jupyter labextension install @jupyter-widgets/jupyterlab-manager”。 - muudscope

2

在JupyterLab中使用:

  1. 安装ipywidgets包:

    使用pip

    pip install ipywidgets

    jupyter nbextension enable --py widgetsnbextension

    使用conda

    conda install -c conda-forge ipywidgets

    (使用conda安装ipywidgets也会为您启用扩展。)

  2. 然后运行以下命令安装Jupyter小部件扩展以支持FigureWidget(请注意,这将需要在您的系统中安装nodeJs):

jupyter labextension install @jupyter-widgets/jupyterlab-manager


Windows用户请注意,在安装完Node.js后需要重新启动Windows。 - drgrujic

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接