0

I am new to TensorFlow and I received error with the third line below saying "ModuleNotFoundError: No module named 'keras'". The code is written in jupyternotebook launched from an anaconda virtual environment.

import tensorflow as tf
from tensorflow import keras
(x_train,y_train)=tf.keras.datasets.mnist.load_data()

I have no problem with importing tensorflow and the second line. I used anaconda navigator to install both tensorflow and keras. (I didn't set anaconda my default python version when installing anaconda, could that be a reason? )Thanks in advance.

Ashwin Phadke
  • 292
  • 3
  • 10
Thea
  • 33
  • 2
  • Did you try any of the solutions mentioned https://stackoverflow.com/questions/45271344/importerror-no-module-named-keras here till now? – Ashwin Phadke Jan 31 '22 at 02:15
  • The "moving the whole keras folder" method from the link works for me. Thank you! – Thea Jan 31 '22 at 04:56

0 Answers0