在虚拟环境中安装jupyter notebook

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

打开anaconda promote
在base 环境中输入conda list
在这里插入图片描述

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

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

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

在这里插入图片描述
解决方法见:

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

输入:

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

    在这里插入图片描述
    再次输入jupyter notebook 启动之后就看到多了所有的环境了

    在这里插入图片描述

    看到下图中有两个路径,一个是c盘的一个路径,是用来放kernel 的
    另一个是我之前在各个开始安装anaconda的时候,修改过jupyter的启动路径的,修改到d盘了
    在这里插入图片描述

    修改jupyter notebook的启动路径

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

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

    在这里插入图片描述

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

    </article>
    
    Logo

    有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

    更多推荐