首先得有虚拟环境
conda create -n my-conda-env # creates new virtual env
conda activate my-conda-env # activate environment in terminal
在虚拟环境中安装 ipykernel
conda install ipykernel # install Python kernel in new conda env
ipython kernel install --user --name=my-conda-env-kernel # configure Jupyter to use Python kernel
jupyter notebook
然后可以直接在jupyter里选择虚拟环境了