Python Forum
It says there is no keras in jupyter notebook. it is wrong there is a keras install
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
It says there is no keras in jupyter notebook. it is wrong there is a keras install
#1
When I run the following code, I get the error shown below.

import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
Output:
ImportError Traceback (most recent call last) <ipython-input-6-7abbf1c8e6c0> in <module> 1 import tensorflow as tf ----> 2 from tensorflow import keras 3 from tensorflow.keras import layers ImportError: cannot import name 'keras'
But keras is there as shown here:

Output:
jupyter_core 4.7.1 py38haa95532_0 jupyterlab-widgets 1.0.0 pypi_0 pypi jupyterlab_pygments 0.1.2 py_0 keras 2.4.3 pypi_0 pypi keras-preprocessing 1.1.2 pypi_0 pypi keras-tuner 1.0.2 pypi_0 pypi kiwisolver 1.3.1 pypi_0 pypi langdetect 1.0.8 pypi_0 pypi
I am using Windows 10 home version with 64bit. The tensorflow version is 2.4.1. It still does not like this line number two.

Output:
from tensorflow import keras
How do I get rid of this error?

Any help appreciated. Thanks in advance.

Respectfully,

LZ
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I'm trying to import a dataset into a Jupyter Notebook Hisilat03 0 691 Mar-24-2025, 09:26 AM
Last Post: Hisilat03
  Jupyter Notebook cell ? flaviu2 6 4,837 Feb-10-2025, 09:39 AM
Last Post: mysqlguider
  import data (.csv) into Jupyter notebook oranstprotonme 2 1,131 Aug-14-2024, 07:08 PM
Last Post: oranstprotonme
  Troubleshooting Jupyter Notebook installation with Python using pip and a venv Drone4four 1 1,941 Jun-04-2024, 10:55 PM
Last Post: Drone4four
  Install python 2.7 in jupyter lab raman 28 4,994 Jun-01-2024, 01:53 PM
Last Post: snippsat
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 4,028 Nov-15-2023, 06:56 PM
Last Post: jst
  Navigating file directories and paths inside Jupyter Notebook Mark17 5 7,575 Oct-29-2023, 12:40 PM
Last Post: Mark17
  How to programmatically stop a program in Jupyter Notebook? Mark17 11 58,278 Feb-12-2023, 01:41 PM
Last Post: jp21in
Thumbs Up Python 3 Jupyter notebook ternary plot data nicholas 0 1,801 Jan-21-2023, 05:01 PM
Last Post: nicholas
  Graphs from Jupyter notebook to word Scott 0 1,566 Nov-28-2022, 06:16 AM
Last Post: Scott

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020