.由於之前安裝的是python2.7 ,tensorflow在windows下必須要python3
網上查了一下有三種方法2版本共存
1.不用Anaconda
2. 用Anaconda更方便:
win7 64位下安裝多版本的python及tensorflow安裝
http://blog.csdn.net/infin1te/article/details/50445217
3. 也可以安裝docker,虛擬一個linux環境,因為在linux環境中python2.7 可以用tensorflow 。這個方法我還沒有試驗成功。
參考https://onmogul.com/ask_anythings/tensorflow-on-python-2-7-windows
Have you tried running it through Docker? Download and install docker toolbox for windows https://www.docker.com/docker-toolbox Open a cmd window, and type:
docker run -it b.gcr.io/tensorflow/tensorflow
This should bring up a linux shell. Type python and I think all would be well!
http://blog.csdn.net/tina_ttl/article/details/51372604
我由於之前安裝2.7版本沒有用Anaconda,所以用第一種方法, tensorflow在win10下只能安裝64位的python3.6 ,python2.7不行,32位的python3.6也不行(參考 64位win10上安裝TensorFlow填坑筆記)。
1.直接官網下載了64位的最新版本python3.6,安裝。改打鈎的勾上,環境變量勾上。
2.安裝完畢,把python2.7的 python.exe 改為python2.exe,然后cmd下運行python,顯示當前版本為3.6.
3. 為解決編碼問題,參考http://blog.csdn.net/qq_24082175/article/details/57079562, 把下面文件改了下

4. pip install tensorflow 一路自動安裝。完美。

5. 要用到matplotlib,直接pip install matplotlib ,完美!

pip install requests
pip install flask
pip install tornado
pip install requests
pip install scikit-learn
pip install networks
pip install beautifulsoup4
pip install python-qt5
pip install自動下載的文件在這里:
win7:
c:\用戶\(你的用戶名)\AppData\Local\pip\cache\
linux:
~/.cache/pip
要去刪除cache的,加入--no-cache-dir 就可以禁用緩存了
