项目场景:
在Jupyter Notebook 运行代码,需要展示进度条即利用到IProgress
,但是,提示IProgress not found. Please update jupyter and ipywidgets。
问题描述:
问题的场景是,我在jupyter notebook 中安装了好几个conda的内核,然后使用base 环境启动的jupyter,使用别的环境运行的python代码。
参照网上别的解决方法,不管是安装ipywidgets
,还是更新相应的包和jupyter都不管用。
原因分析:
其实原因是因为我们的Jupyter启动环境(base)和代码的内核环境不同,导致的。在 ipywidgets官网人家给出了这种情况的解决方法。
解决方案:
在jupyter的启动环境下(base环境),
conda install -n base -c conda-forge widgetsnbextension
在使用具体的内核的环境下执行:
conda install -n 内核环境名 -c conda-forge ipywidgets