jupyter notebook 踩坑(win平台、添加kernel、dll缺失)

jupyter 常用命令

添加kernel,在对应的虚拟环境中操作

# 创建虚拟环境如 TF2(有环境的可以直接下一步)

conda create -n TF2 python=3.8

# 进入虚拟环境

conda activate TF2

# 安装jupyter notebokk

conda install jupyter notebook(推荐)

pip install jupyter notebook (也可)

# 安装ipykernel

conda install ipykernel

# 将虚拟环境加入jupyter

python -m ipykernel install --name tf2(注意:名字不必与虚拟环境相同)

# 查看当前jupyter中的kernel

jupyter kernelspec list

# 从jupyter中移除kernel

jupyter kernelspec remove tf2

jupyter常见问题

启动kernel  ImportError: DLL load failed: 找不到指定的模块。

各种ImportError: DLL load failed,找到对应module,重新安装

特别:如果是numpy引发的问题,可能同时用pip和conda安装过numpy,

卸载conda版本的numpy,conda uninstall numpy。

使用pip show numpy 查看是否存在numpy,否则pip install numpy

做深度学习,使用transformers库,会联网下载模型,可能缺失ipywidgets

切记:

先用pip install ipywidgets安装,不管用,再用conda install ipywidgets

我的conda安装了也不能用,卸载的话,很多包会丢失,导致kernel异常,重新配置kernel。

pip 安装ipywidgets成功,可用。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值