解决报错ImportError: IProgress not found. Please update jupyter and ipywidgets.

问题描述

在用transformers模型导入预训练模型时,报错:

ImportError: IProgress not found. Please update jupyter and ipywidgets. 
See https://ipywidgets.readthedocs.io/en/stable/user_install.html

解决方法

(1)首先很多博客说是jupyter的版本过低了,但是卸载再重装也不行:

# 可以先用你的环境 conda activate xx
# 卸载jupyter:
pip uninstall jupyter
# 安装jupyter
pip install jupyter

(2)因为报错也说了可能和木有ipywidgets有关,就下载这个包后还是不行:

pip install ipywidgets

(3)冷静!找出终极绝招,jupyer官方文档:https://ipywidgets.readthedocs.io/en/stable/user_install.html,就是说如果你的jupyter和你运行代码的kernel不是一个环境的话:
在这里插入图片描述

conda install -n base -c conda-forge widgetsnbextension
conda install -n py36 -c conda-forge ipywidgets

首先进入base环境运行:

conda install -c conda-forge widgetsnbextension

然后在自己的虚拟环境中运行(如虚拟环境名为myconda):

source activate myconda
conda install -c conda-forge ipywidgets

如果还不行就很可能是jupyterlab版本过低,升级一波即可。

Reference

(1)https://blog.csdn.net/z124665532/article/details/121268416

评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

山顶夕景

小哥哥给我买个零食可好

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值