Same problem occurred for me
import tensorflow as tf
hello = tf.constant('Hello World ')
sess = tf.compat.v1.Session() *//I got the error on this step when I used
tf.Session()*
sess.run(hello)
Try replacing it with tf.compact.v1.Session()