首先查看下本地环境
(base) apple@yyq # conda env list
# conda environments:
#
base /Volumes/BanQ/opt/conda/anaconda3
airplane /Volumes/BanQ/opt/conda/anaconda3/envs/airplane
py_36 /Volumes/BanQ/opt/conda/anaconda3/envs/py_36
py_37 * /Volumes/BanQ/opt/conda/anaconda3/envs/py_37
py_38 /Volumes/BanQ/opt/conda/anaconda3/envs/py_38
tensor_37 /Volumes/BanQ/opt/conda/anaconda3/envs/tensor_37
安装ipykernel
输入以下命令退出当期虚拟环境,并安装ipykernel。
conda deactivate ##退出当前虚拟环境
conda install ipykernel ##安装ipykernel
进入已建虚拟环境中安装ipykernel
conda activate py_37
python -m ipykernel install --name py_37 --display-name "python_37"
#py_37是指已建环境名;python_37是指想要在jupyter notebook中显示的名字
打开Jupyter Notebook并选择所需虚拟环境
附
查看已有的kernel
jupyter kernelspec list
删除不想要的kernel:
jupyter kernelspec uninstall unwanted-kernel
在配置文件里配置别名 后台启动jupyter
alias note='nohup jupyter notebook >jupyter.log 2>&1 &'