windows系统下,cmd进入终端,输入以下代码
conda install -n tf2 ipykernel
tf2是我的环境名称,替换成自己的python环境。
然后运行以下代码激活。
python -m ipykernel install --user
再打开jupyter notebook
jupyter notebook
在kernel下可以找到本地环境tf2
在ubuntu系统下,上面的方法好像没用,用下面的方法可行(不知道为啥)
conda install nb_conda
更新,在ubuntu系统下,使用上面方法之后,可以在jupyter 上找到环境,但是老是连接不上,用下面方法解决。参考https://blog.csdn.net/qq_41644339/article/details/107666748
pip install --user --ignore-installed jupyter