基于Anaconda的jupyter notebook配置虚拟环境,使用并退出jupyter notebook

首先需要先conda create创建自己的虚拟环境

接下来打开 Anaconda prompt

激活创建的虚拟环境(我创建的虚拟环境是 F:\conda_environment\pytorch)

基于Anaconda的jupyter notebook配置虚拟环境,使用并退出jupyter notebook_第1张图片

然后在虚拟环境中安装ipykernel

输入:conda install ipykernel

 之后再继续安装nb_conda

输入: conda install -c conda-forge nb_conda

这样就安装好了,然后就直接输入:jupyter notebook

即可打开网页进入jupyter notebook如下图: 

基于Anaconda的jupyter notebook配置虚拟环境,使用并退出jupyter notebook_第2张图片

再右上角的New中就可以选择刚创建好的虚拟环境,然后点击就可以进入到所配置的虚拟环境的jupyter notebook中去了

基于Anaconda的jupyter notebook配置虚拟环境,使用并退出jupyter notebook_第3张图片

简单验证一下我的pytorch是否安装成功

基于Anaconda的jupyter notebook配置虚拟环境,使用并退出jupyter notebook_第4张图片

在使用jupyter notebook时不能将前面打开的Anaconda prompt关闭,否则会断开连接

退出jupyter notebook时,将jupyter notebook页面关掉,然后在Anaconda prompt按下快捷键Ctrl

+C,即可返回到命令行的形式

基于Anaconda的jupyter notebook配置虚拟环境,使用并退出jupyter notebook_第5张图片

 

 

 

 

你可能感兴趣的:(jupyter,python,pytorch)