python的虚拟环境中使用jupyter

仅作为记录,大佬请跳过。

背景

博主在base环境中(linux服务器),能够使用jupyter notebook(具体操作可参考博主文章:传送门)

然后,博主创建了一个python虚拟环境
在xshell中输入conda create -n envjupyter python=3.7 -y,然后输入conda activate envjupyter进入虚拟环境,这时使用jupyter notebook命令时,显示jupyter: command not found

python的虚拟环境中使用jupyter_第1张图片
在这里插入图片描述

博主以为需要在虚拟环境中安装jupyter notebook,其实不用,只需conda install内核jupyter部件即可。

解决

在xshell中输入:

conda install nb_conda
conda install -n envjupyter ipykernel

(这里的envjupyter是博主起的虚拟环境的名字,需要修改成自己的虚拟环境名字)

此时再次运行:

jupyter notebook

,发现可行
python的虚拟环境中使用jupyter_第2张图片
python的虚拟环境中使用jupyter_第3张图片

参考

感谢大佬博主文章:传送门

python的虚拟环境中使用jupyter_第4张图片

你可能感兴趣的:(linux,python,python,jupyter,开发语言)