[英]Displaying progress bar using tqdm has error "Widget Javascript not detected…
我正在尝试使用tqdm显示进度条。 我的系统是Windows 7 64位。 使用conda conda install tqdm
不适用。 因此,我使用anaconda提示符中的命令从https://anaconda.org/conda-forge/tqdm安装了tqdm,如下所示:
conda install -c conda-forge tqdm=4.8.4
我用以下示例测试它
from tqdm import tnrange, tqdm_notebook
from time import sleep
for i in tnrange(4,desc='1st loop'):
for j in tnrange(10, desc='2nd loop'):
sleep(0.01)
IPython控制台显示以下消息:
Widget Javascript not detected. It may not be installed properly. Did you enable the widgetsnbextension? If not, then run "jupyter nbextension enable --py --sys-prefix widgetsnbextension"
我可以知道如何解决这个问题吗? 先感谢您。
发生错误是因为您无法在Spyder的IPython控制台中评估专门在Jupyter笔记本中运行的内容。
这是因为他们使用了使用不同技术构建的前端:带有HTML,CSS和Javascript的笔记本以及带有Qt图形工具包的IPython控制台(依赖于qtconsole包)。
这是IPython的一个老错误。 您需要安装最新的ipywidgets软件包(使用conda),也可以更新Jupyter / IPython。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.