I installed tensorflow in anaconda following the instructions in main website.But 'import tensorflow' is only working for python that's in tensorflow folder in envs of anaconda. The python3.6 of anaconda is not importing tensorflow.
2 Answers
I also faced the similar challenge The following way worked for me
Step 1: install the anaconda latest
step 2: C:> conda create -n tensorflow python=3.5
though your anaconda python is 3.6 tensorflow works on 3.5
step 3: C:> activate tensorflow
(tensorflow)C:> # Your prompt should change
step 4:
4.1 : command for CPU
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp35-cp35m-win_amd64.whl
4.2 : command for GPU
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.2.1-cp35-cp35m-win_amd64.whl
Step 5(Validating the installation of tensorflow)
(start new terminal)
$ python
(enter the following command)
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
the output should be
Hello, TensorFlow!
Step6: Open Anaconda Navigator change the Application on from "Root to Tensorflow" channel (top left)
Step 7: Now install the required jupyter or spyder that you wish to work with (post installation launch the notebook it will work)

- 65
- 8
Do the install steps but replace 3.5 or 35 with 3.6 or 36. Works for me.
conda create -n tensorflow python=3.6
activate tensorflow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp36-cp36m-win_amd64.whl
Reference: Installing TensorFlow on Windows

- 10,956
- 4
- 46
- 66