Anaconda新建tensorflow环境下后解决The kernel appears to have died. It will restart automatically.

时间:2024-03-24 22:52:21

所遇情况:
Anaconda新建了一个tensorflow的环境(我自己的取名为tfenv)之后在jupter notebook中import numpy 和 matplotlib中的包时出现: “The kernel appears to have died. It will restart automatically.”
启动(tfenv)环境之后,conda安装这些包之后在Prompt终端运行并导入都没问题,
Anaconda新建tensorflow环境下后解决The kernel appears to have died. It will restart automatically.
但是在jupyter notebook就出现问题,“The kernel appears to have died. It will restart automatically.”


我的解决方法:

1,启动自己的tensorflow所在的环境之后,先用卸载导入有问题的包
conda uninstall numpy 
conda uninstall matplotlib
2,更新自己的pip版本
python  -m pip install --upgrade pip
3,不要用conda安装!要改用pip命令安装numpy 和 matplotlib
pip install numpy
pip install matplotlib
4,重新启用
jupyter notebook
5,完毕

我的numpy 和matplotlib 已经正常:
Anaconda新建tensorflow环境下后解决The kernel appears to have died. It will restart automatically.