使用Conda来配置Jupyter notebook的虚拟环境

1.下载anconda或者miniconda

教程网上很多随便找一个即可,别忘了添加环境变量

2.创建虚拟环境

conda create -n 环境名 python=3.7 版本号可以自己设置

3.通过jupyter notebook打开conda虚拟环境

jupyter notebook原本是只有base基础环境,需要通过安装第三方库ipykernel,先进入需要添加的虚拟环境,然后通过命令将虚拟环境添加到jupyter notebook

3.1 首先安装包 ipykernel(先进入需要添加的虚拟环境中conda activate ipykernel)
conda install ipykernel / pip install ipykernel
3.2 添加虚拟环境进jupyter notebook
python -m ipykernel install --user --name 虚拟环境名 --display-name 虚拟环境名

4.添加成功

posted @ 2022-07-12 12:36  TCcjx  阅读(960)  评论(0编辑  收藏  举报