最近看论文跑代码,每个论文的代码可能都是不同python版本的环境,所以安装了Anaconda,但Jupyter之前装在了本地的Python环境下,记录一下常用的创建虚拟环境命令和将虚拟环境导入Jupyter的命令
- 创建conda虚拟环境
conda create -n myenvname python=3.x
- 删除虚拟环境
conda env remove --name myenvname
- 查看conda环境
conda env list
- 虚拟环境导入Jupyter
activate myenvname
pip install ipykernel # 没有安装ipykernel的话需要安装一下
python -m ipykernel install --user --name myenvname
- 查看Jupyter内核列表
jupyter kernelspec list
- 删除内核
jupyter kernelspec remove myenvname
Jupyter中切换内核的地方