Using a :
- macOS High Sierra version 10.13.5
- python version is 2.7.10
I am trying to install tensorflow on my macOS through native pip but i encountered an issue when trying to validate my installation. I am following the installation instructions from this website :
[1] https://www.tensorflow.org/install/install_mac#top_of_page
The issue occurs when I run the following short tensorflow program after I invoke python from it's shell
# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
but I get in return :
... import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
ImportError: No module named tensorflow
>>> hello = tf.constant('Hello, TensorFlow!')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'tf' is not defined
>>> sess = tf.Session()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'tf' is not defined
>>> print(sess.run(hello))
I used the following links to see if i can find the answer
ImportError: No module named tensorflow
https://github.com/tensorflow/tensorflow/issues/5478
ImportError: No module named tensorflow - Can't install Tensorflow
Also during the installation of native pip I did sudo install tornado & nose. The versions are Tornado 5.1 & nose 1.3.7