Jupyter Notebook中使用虚拟环境
时间:2020-08-13 00:17:29
收藏:0
阅读:355
1、在主环境中安装ipykernel:
conda install ipykernel
2、在虚拟环境中安装ipykernel:
conda install -n 环境名称 ipykernel(或则进去虚拟环境中安装)
3、进入虚拟环境中,将环境写入notebook的kernel中
conda activate pytorch
python -m ipykernel install --user --name 环境名称 --display-name "显示的名称"
如:python -m ipykernel install --user --name pytorch --display-name pytorch
4、重新打开jupyter:jupyter notebook
5.删除kernel环境:
jupyter kernelspec remove 环境名称
原文:https://www.cnblogs.com/zhengzian/p/13493735.html
评论(0)