本地已经安装了keras的安装包,jupyter book在运行import keras时还是会报错:No module named 'keras'
解决方案有三种
1、Anaconda Navigator
在Anaconda Navigator中环境中添加jupyter和notebook。
2、添加tensorflow kernel
在Anaconda Prompt中操作:
(1)查看当前可用kernel:jupyter kernelspec list
(2)激活虚拟环境:activate tensorflow (注:tensorflow是之前创建的虚拟环境名)
(3)在tensorflow虚拟环境下,安装ipykernel:
conda install ipykernel
python -m ipykernel install --name tensorflow
删除kernel:jupyter kernelspec remove env_name(如果不小心添加错了kernel,用此命令删除)
(4)运行jupyter notebook:jupyter notebook