打开想要添加的conda环境 conda activate xxx
安装ipykernel
pip install ipykernel -i https://pypi.tuna.tsinghua.edu.cn/simple
通过ipykernel为jupyter添加xxx环境 名字叫做yyy
python -m ipykernel install --name yyy
如果报错:cannot import name “AsyncGenerator”
#降低prompt-toolkit版本
pip install --upgrade prompt-toolkit==2.0.1
如果报错:Permission denied: '/usr/local/share/jupyter',是因为权限不够,加上--user即可
python -m ipykernel install --user --name yyy
然后查看jupyter 内核,看看有没有yyy,有的话就成功了
jupyter kernelspec list
需要删除的话, jupyter 删除内核
jupyter kernelspec remove yyy