jupyter报错IProgress not found. Please update jupyter and ipywidgets

一、jupyter notebook指定python解释器

一般情况下,jupyter所使用的解释器就是anaconda自带的解释器,而我们习惯使用的是虚拟环境的解释器。这里以指定虚拟环境的解释器为例

conda activate emotiona_analysis  # 切换到虚拟环境emotiona_analysis 

pip install ipykernel    #   在虚拟环境中安装 ipykernel 包

python -m ipykernel install --name emotiona_analysis   # 向 jupyter 中添加虚拟环境

完成以上步骤后重启jupyter即可

二、Python项目如何生成依赖库文件“requriements.txt”

pip install pipreqs #安装 pipreqs
# cd 到项目路径下,执行以下命令
# 如果已经存在requirements.txt,需要加上 --force 覆盖之
# 如果提示“UnicodeDecodeError: 'gbk' codec can't decode ”的错误,需要指定字符集 --encoding=utf8
# 如果有想要忽略的目录,可以使用 --ignore <dirs> ...忽略额外的目录
pipreqs ./ --encoding=utf8 --force # 生成requirements文件
pip install -r requirements.txt #使用 requirements.txt 安装依赖的方式

三、jupyter报错IProgress not found. Please update jupyter and ipywidgets

问题:
官方文档说的很清楚:如果你的jupyter和你运行代码的kernel不是一个环境的话,按底下这么做就行。

#第一步,在base环境运行:

conda install -c conda-forge widgetsnbextension
#第二步,进入你的虚拟环境并运行(py36是你虚拟环境的名字,自行替换):

source activate py36
conda install -c conda-forge ipywidgets
#或者直接像官方文档图那样的直接安装到指定名字的环境里面也行。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Indra_ran

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值