本地已经安装了keras的安装包,jupyter book在运行import keras时还是会报错:No module named ‘keras’
解决方案有三种
1、A naconda 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
(5)jupyter notebook页面切换kernel
new—>tensorflow
成功!!!
3、在cmd中操作
(1)激活虚拟环境:activate tensorflow (注:tensorflow是之前创建的虚拟环境名)
(2)安装nb_conda:conda install nb_conda
(3)运行jupyter notebook:jupter notebook
Original: https://blog.csdn.net/m0_61832505/article/details/122060561
Author: 白梨栗栗梨
Title: jupyter book 中 No module named ‘keras‘问题
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/511986/
转载文章受原作者版权保护。转载请注明原作者出处!