1. 在 Anaconda Prompt 中 创建虚拟环境 tf
命令行:conda create -n tf python=3.8
tf :自己要创建的虚拟环境名称
python=3.8 是Anaconda 中对应的python版本
2. 在 base 环境下 安装 ipykernel
命令行: pip install ipykernel
![在这里插入图片描述](https://img-blog.csdnimg.cn/879036f19d904fd592bc40b3f6d9fae2.png)
3. 激活虚拟环境 tf
命令行:conda activate tf
![在这里插入图片描述](https://img-blog.csdnimg.cn/b9aed1f163014236bb8948aacdd9444a.png)
4. 在虚拟环境 tf 中安装 ipykernel
命令行:pip install --user ipykernel
![在这里插入图片描述](https://img-blog.csdnimg.cn/f582cb2a4cfe449eb790c292bb3b9254.png)
5.将虚拟环境 tf 添加到 jupyter Notebook 中
命令行:python -m ipykernel install --user --name=tf
![在这里插入图片描述](https://img-blog.csdnimg.cn/b699f623235b4f75ac3c69b723e444cf.png)
6.打开 jupyter notebook ,点击 kernel 即可切换环境。