The following program works well under anaconda from command line interface (I am using Mac OS), but it has errors about cannot import/find tensorflow module from PyCharm (using Python 2.7). I already set Python interpreter to be anaconda in PyCharm, still got this error. If anyone have any ideas, it will be great.
Here is the simple program I am using and also the screen snapshot of PyCharm.
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
a = tf.constant(10)
b = tf.constant(32)
print(sess.run(a + b))
Update 1, how I setup Python interpreter in PyCharm,
Update 2, post output for python -c 'import sys; print(sys.path)'
['', '/Users/admin/miniconda2/lib/python2.7/site-packages/six-1.10.0-py2.7.egg', '/Users/admin/miniconda2/lib/python27.zip', '/Users/admin/miniconda2/lib/python2.7', '/Users/admin/miniconda2/lib/python2.7/plat-darwin', '/Users/admin/miniconda2/lib/python2.7/plat-mac', '/Users/admin/miniconda2/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/admin/miniconda2/lib/python2.7/lib-tk', '/Users/admin/miniconda2/lib/python2.7/lib-old', '/Users/admin/miniconda2/lib/python2.7/lib-dynload', '/Users/admin/miniconda2/lib/python2.7/site-packages']
Update 3,
Post File menu and PyCharm version,
Update 4, Preferences => Project Interpreter setting,
Update 5, package list screen snapshot,
Update 6, using miniconda other than conda seems no issues, post screen snapshots,
python -c 'import sys; print(sys.path)'
and see what it says? – edwinkslPreferences => Project Interpreter setting
, istensorflow
listed among the packages? – Moses Koledoye