ModuleNotFoundError:Jupyter Notebook没有名为"keras"的模块 [英] ModuleNotFoundError: No module named 'keras' for Jupyter Notebook

查看:562
本文介绍了ModuleNotFoundError:Jupyter Notebook没有名为"keras"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Jupyter Notebook,并且发生以下错误

I was running Jupyter Notebook and the following error occurs

ModuleNotFoundError
追溯(最近一次通话) 在 ---->

ModuleNotFoundError
Traceback (most recent call last) in ---->

从keras.models导入顺序

from keras.models import Sequential

从keras.layers导入(
Conv2D,MaxPooling2D,展平,密集,退出)

from keras.layers import (
Conv2D, MaxPooling2D, Flatten, Dense, Dropout)

ModuleNotFoundError:没有名为"keras"的模块

ModuleNotFoundError: No module named 'keras'

我尝试使用 import sys; sys.path找到了

['/home/xxx/notebook',
 '/home/xxx/anaconda3/lib/python37.zip',
 '/home/xxx/anaconda3/lib/python3.7',
 '/home/xxx/anaconda3/lib/python3.7/lib-dynload',
 '',
 '/home/xxx/anaconda3/lib/python3.7/site-packages',
 '/home/xxx/anaconda3/lib/python3.7/site-packages/IPython/extensions',
 '/home/xxx/.ipython']

安装是否有问题?我需要重新安装从python到anaconda的所有内容.有人可以指出我正确安装了蟒蛇

Is there any problem with the installation? Do I need to reinstall everything from python to anaconda. Would some be able to point me to a proper installation of anaconda

顺便说一句,如果您已经安装了python,是否应该再次通过anaconda安装python软件包

BTW, if u have installed python, should you install python package through anaconda again

谢谢

推荐答案

使用前必须先安装所有依赖项. 尝试使用

You have to install all the dependencies first before using it. Try using

  • conda安装tensorflow
  • conda安装keras

通过使用conda命令安装它,可以管理您与其他库的版本兼容性.

by installing it with conda command it manage your versions compatibility with other libraries.

仅在您当前的环境中安装,并且该库的最新版本有时与其他库不兼容,因此我们必须注意版本兼容性.

with pip install libraries will only install in your current environment and the latest version of the library sometimes latest libraries are not compatible with the other libraries so we have to take care of version compatibility.

这篇关于ModuleNotFoundError:Jupyter Notebook没有名为"keras"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆