anaconda在虚拟环境中安装jupyter notebook|解决jupyter notebook中不存在虚拟环境的问题|修改jupyter notebook的启动路径

目录

  • 在虚拟环境中安装jupyter notebook
  • 解决jupyter notebook中不存在虚拟环境的问题
  • 修改jupyter notebook的启动路径

在虚拟环境中安装jupyter notebook

在安装anaconda的时候jjupyter notebook一般默认安装在base环境中
当新建了一个虚拟环境时,如何安装jupyter notebook呢?

打开anaconda promote
在base 环境中输入conda list
anaconda在虚拟环境中安装jupyter notebook|解决jupyter notebook中不存在虚拟环境的问题|修改jupyter notebook的启动路径_第1张图片

这就是jupyter notebook安装所依赖的包
但是,进入一个新的虚拟环境中,没有这个包,所以我们需要install他。
激活环境activate pytorchcpu
然后输入conda install nb_conda
安装好了之后,输入jupyter notebook打开即可

解决jupyter notebook中不存在虚拟环境的问题

但是,打开网页之后并不存在这个虚拟环境

anaconda在虚拟环境中安装jupyter notebook|解决jupyter notebook中不存在虚拟环境的问题|修改jupyter notebook的启动路径_第2张图片
解决方法见:

https://www.cnblogs.com/yongjieShi/p/10452916.html

输入:

python -m ipykernel install --user --name pytorchcpu --display-name "pytorchcpu"

anaconda在虚拟环境中安装jupyter notebook|解决jupyter notebook中不存在虚拟环境的问题|修改jupyter notebook的启动路径_第3张图片
再次输入jupyter notebook 启动之后就看到多了所有的环境了

anaconda在虚拟环境中安装jupyter notebook|解决jupyter notebook中不存在虚拟环境的问题|修改jupyter notebook的启动路径_第4张图片

看到下图中有两个路径,一个是c盘的一个路径,是用来放kernel 的
另一个是我之前在各个开始安装anaconda的时候,修改过jupyter的启动路径的,修改到d盘了
anaconda在虚拟环境中安装jupyter notebook|解决jupyter notebook中不存在虚拟环境的问题|修改jupyter notebook的启动路径_第5张图片

修改jupyter notebook的启动路径

具体修改jupyter notebook的启动路径方法见:

https://www.cnblogs.com/noticeable/p/9006861.html

anaconda在虚拟环境中安装jupyter notebook|解决jupyter notebook中不存在虚拟环境的问题|修改jupyter notebook的启动路径_第6张图片

我的要修改的那一行在261 如上图。

你可能感兴趣的:(小Tips,anaconda,python)