当前位置:网站首页 > PyTorch框架 > 正文

怎么删除虚拟环境jupyter(删除pytorch虚拟环境)



查看当前已创建的虚拟环境

使用jupyter notebook时可能会发现里面没有已经创建的虚拟环境,可以在命令行中输入:conda env list查看已经创建的虚拟环境(如图1)。图中的*表示当前激活的是名为d2l的虚拟环境,默认情况*在base那一行。

图1 已创建的虚拟环境列表

查看jupyter notebook中能使用的虚拟环境

打开jupyter notebook后点击new,可以看到能在jupyter notebook中使用的虚拟环境。(图2)

图2 查看jupyter notebook中能使用的虚拟环境

在jupyter notebook添加已创建的虚拟环境

接下来介绍将我创建的一个虚拟环境tensorflow添加到jupyter notebook

在命令行中输入命令:python -m ipykernel install --name tensorflow(图3)这里的tensorflow是我创建的虚拟环境名,如果想要添加其他的虚拟环境到jupyter notebook中,将这里的tensorflow换成其他虚拟环境的名字即可。

图3 添加虚拟环境tensorflow到jupyter notebook

在jupyter notebook中切换虚拟环境

再次打开jupyter notebook,在kernel栏选择Change kernel就可以看到tensorflow添加到虚拟环境了(图4),点击pytorch在jupyter notebook中就会使用pytorch虚拟环境,点击d2l在jupyter notebook中就会使用d2l虚拟环境,需要切换不同的虚拟环境只需要点击不同的环境名即可。

图4 在jupyter notebook中切换虚拟环境

到此这篇怎么删除虚拟环境jupyter(删除pytorch虚拟环境)的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • pytorch模型部署到web(pytorch模型部署到树莓派)2025-07-28 18:45:07
  • pytorch模型部署到web(pytorch模型部署到Linux)2025-07-28 18:45:07
  • 尽情享受生活之乐趣——蒙田2025-07-28 18:45:07
  • 一)pytorch框架与环境搭建_一)pytorch框架与环境搭建2025-07-28 18:45:07
  • pytorch深度学习框架基本介绍_pytorch深度学习框架基本介绍2025-07-28 18:45:07
  • pytorch模型部署(pytorch模型部署到web)2025-07-28 18:45:07
  • pytorch模型部署onnx(pytorch模型部署到orin)2025-07-28 18:45:07
  • pytorch模型部署 django(pytorch模型部署单片机)2025-07-28 18:45:07
  • pytorch模型部署到安卓(pytorch 安卓)2025-07-28 18:45:07
  • pytorch模型部署(pytorch模型部署到树莓派)2025-07-28 18:45:07
  • 全屏图片