栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

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

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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成功,可用。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1030203.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号