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()
a = tf.constant(10)
b = tf.constant(32)
print(sess.run(a + b))
python -c 'import sys; print(sys.path)'
Preferences => Project Interpreter setting, is tensorflow listed among the packages?
Apparently No (from your screenshots).
Are there any other python conda installations when you use the drop down on project interpreter? If there are, try those and see what happens. The
tensorflow package is definitely in another
From this post on SO:
conda is the package manager. Anaconda is a set of about a hundred packages including conda, numpy, scipy, ipython notebook, and so on.
You installed Miniconda, which is a smaller alternative to Anaconda that is just conda and its dependencies (as opposed to Anaconda, which is conda and a bunch of other packages like numpy, scipy, ipython notebook, etc.). Once you have Miniconda, you can easily install Anaconda into it with conda install anaconda.
So conda is a package manager, Anaconda is a collection of packages and miniconda (emphasis mine) is a light weight alternative to Anaconda.
You should into setting up a virtualenv to avoid such problems in the future.