博客原文地址:https://blog.csdn.net/index20001/article/details/73555182
https://www.cnblogs.com/HongjianChen/p/8385547.html
親測有用,感謝博主
安裝好Anaconda后,打開Anaconda Prompt

1、建立一個conda計算環境,命名為tensorflow
conda create -n tensorflow python=3.6
2、激活環境,使用conda安裝tensorflow(同樣可選CPU或GPU版本)
activate tensorflow (tensorflow)C:\>pip3 install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
3、安裝cpu版本的tensorflow
pip install --upgrade --ignore-installed tensorflow
當不使用tensorflow時,通過deactivate來關閉tensorflow環境
4、測試是否安裝成功,在終端進入python,輸入import tensorflow as tf測試是否安裝成功

#TensorFlow使用圖(Graph)來表示計算任務;並使用會話(Session)來執行圖,通過Session.close()來關閉會話(這是一種顯式關閉會話的方式)。會話方式有顯式和隱式會話之分。
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!') #初始化一個TensorFlow的常量
sess = tf.Session() #啟動一個會話
print(sess.run(hello))

5、以上算是Anaconda中安裝好了Tensorflow,要想在Jupyter上使用,還需要進行如下配置
接着安裝ipython,安裝jupyter
(tensorflow)D:\>conda install ipython (tensorflow)D:\>conda install jupyter
6、接着輸入:
(tensorflow)D:\>ipython kernelspec install-self --user
看到這個結果
Installed kernelspec python3 in C:\Users\XXX\Jupyter\kernels\python3
然后再去 jupyter notebook 新建一個文件,試試 import tensorflow as tf,這時應該就可以用啦。
7、在jupyter新建一個,輸入 import tensorflow as tf 如果不報錯就說明成功引入啦!
附1. 刪除已建的conda環境,該環境必須處於未激活狀態,才能刪除
(tensorflow)D:\>deactivate tensorflow D:\>conda remove -n tensorflow --all D:\>conda info --envs ··· 再看一下還有的conda環境,tensorflow那個環境沒有啦。
