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

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

问题描述

在用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不是一个环境的话:

image.png

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版本过低,升级一波即可。

相关文章
使用pip时报错:No module named ‘chardet‘ 的解决办法
使用pip时报错:No module named ‘chardet‘ 的解决办法
1634 0
使用pip时报错:No module named ‘chardet‘ 的解决办法
|
Ubuntu Python
pip3 执行错误 No module named 'distutils.cmd'
pip3 执行错误 No module named 'distutils.cmd'
1727 0
|
2月前
|
缓存 Python
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-npf9报错
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-npf9报错
|
4月前
|
安全 数据安全/隐私保护 开发者
【Python】 已解决:ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: ‘e:\anaconda\i
【Python】 已解决:ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: ‘e:\anaconda\i
543 11
【Python】 已解决:ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: ‘e:\anaconda\i
|
4月前
|
Linux 数据安全/隐私保护 开发者
【Python】已解决:ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: ‘e:\anaconda\in
【Python】已解决:ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: ‘e:\anaconda\in
1214 2
|
4月前
|
安全 网络安全 Python
【Python】已解决:(pip安装库报错)ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访
【Python】已解决:(pip安装库报错)ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访
122 0
|
4月前
|
Python
安装 supervisor报错执行python setup.py install时No local packages or working download links found for meld3
安装 supervisor报错执行python setup.py install时No local packages or working download links found for meld3
34 0
|
Python
Python常见问题 - pip报错 ValueError: Unable to find resource t64.exe in package pip._vendor.distlib
Python常见问题 - pip报错 ValueError: Unable to find resource t64.exe in package pip._vendor.distlib
430 0
Python常见问题 - pip报错 ValueError: Unable to find resource t64.exe in package pip._vendor.distlib
|
数据可视化 Python
常见的bug---5、在安装superset时候报错,Command “python setup.py egg_info“ failed with error code 1
常见的bug---5、在安装superset时候报错,Command “python setup.py egg_info“ failed with error code 1
如何解决 conda install 库时报错:The environment is inconsistent, please check the package plan carefully
如何解决 conda install 库时报错:The environment is inconsistent, please check the package plan carefully
如何解决 conda install 库时报错:The environment is inconsistent, please check the package plan carefully