Import “tensorflow.keras” could not be resolved after upgrading to TensorFlow 2.8.0 April 8, 2024 by Tarik I had the same problem and resolved it by importing it as from tensorflow.python.keras.layers import Dense