LoginSignup
2
2

More than 3 years have passed since last update.

Jupyter notebook でtqdmが使えない場合の対処法

Last updated at Posted at 2021-03-29

使い方

Jupyter notebook または Jupyter lab では次のようにしてtqdmを用います。


from tqdm.notebook import tqdm

total = 0
for i in tqdm(range(1,11)):
    total += i

エラーと対処法

次のようなエラーが出た場合、

HBox(children=(IntProgress(value=0, max=5), HTML(value='')))

Jupyter notebook の拡張機能がインストールされていないことが原因のため、次の2つをshellで実行してインストールします。インストールするためにはNode.jsnpmがインストール済でなければなりません。

jupyter nbextension enable --py widgetsnbextension
jupyter labextension install @jupyter-widgets/jupyterlab-manager

インストール後にnotebookを再起動すれば、 下の図のようなプログレスバーを表示させることができます。

スクリーンショット 2021-03-29 14.46.55.png

参考

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2