首页 > 其他分享 >为Jupyter notebook创建新kernel

为Jupyter notebook创建新kernel

时间:2022-08-22 10:26:41浏览次数:78  
标签:kernel Jupyter ipykernel -- python pytorch notebook gpu

在新的虚拟环境中创建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

标签:kernel,Jupyter,ipykernel,--,python,pytorch,notebook,gpu
From: https://www.cnblogs.com/ddqdd/p/16611900.html

相关文章

  • Mac安装python jupyter notebook
    前置条件:已安装python3查看当前python版本:python--version如果不使用虚拟环境,直接用步骤3和步骤4即可。1.创建虚拟环境:pip3installvirtualenvpython3-mvirtuale......
  • juypter notebook中报找不到scipy,torchvision的问题
    在初入深度学习使用juypter这块经常遇到各种问题,每次都被搞的很痛苦; 下面给大家带来我的一点问题解决方案: 首先检查下anaconda中有没有安装scipy这些模块,没有的话在......
  • 关于安装Anaconda,以及GPU版的tensorflow,pytorch,最后配置jupyter
    1.首先是关于Anaconda的安装:  直接到官网上下载对应版本,直接安装,可以自定义安装目录,但是要注意的是你安装的目录必须是全英文(就很烦!)    然后是接下来的步骤......
  • jupyter 安装配置
    jupyter安装配置参考文章虽然不建议用root权限去运行pip或者jupyter,但是暂时为了方便省事,以下使用是的root权限。#安装pipinstalljupyternotebook#利用python......
  • Jupyter Notebook切换内核无法打开
    报错如下所示:[I18:13:05.891NotebookApp]KernelRestarter:restartingkernel(4/5),newrandomportsTraceback(mostrecentcalllast):File"D:\Anaconda\Ma......