为Jupyter notebook创建新kernel

在新的虚拟环境中创建kernel

进入需要创建kernel的虚拟环境

conda activate pytorch

安装ipykernel

ipykernel是必须安装的,也可以直接安装jupyter ,会自动包含ipykernel

pip install ipykernel

创建kernel

python -m ipykernel install --user --name pytorch --display-name  pytorch
# python -m ipykernel install --user --name 环境名称 --display-name kernel名称
# python -m ipykernel install --name kernel名称

验证

常用命令

# 查看kernel链接列表
jupyter kernelspec list

# 删除kernel链接
# jupyter kernelspec remove pytorch_gpu (kernel所在的环境名称)
jupyter kernelspec remove pytorch_gpu 

# 创建虚拟环境
# conda create -n pytorch_gpu(环境名称) python=3.7(python版本号)
conda create -n pytorch_gpu python=3.7

# 删除虚拟环境
# conda remove -n pytorch_gpu(环境名称) --all
conda remove -n pytorch_gpu --all

参考:https://blog.csdn.net/qq_24520431/article/details/119829684?spm=1001.2101.3001.6650.7&utm_medium=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~Rate-7-119829684-blog-82912189.t5_layer_eslanding_s_randoms&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~Rate-7-119829684-blog-82912189.t5_layer_eslanding_s_randoms&utm_relevant_index=8

本文作者:听雨画船眠

本文链接:https://www.cnblogs.com/ddqdd/p/16611900.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   听雨画船眠  阅读(496)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起