1. 安裝python 這里采用py3.5? 64位 python3.5 64 下載? 安裝完成后配置環(huán)境變量
我的電腦->鼠標(biāo)右鍵->屬性->高級系統(tǒng)設(shè)置->環(huán)境變量?
點擊環(huán)境變量 在系統(tǒng)變量里找到 變量名為 Path? 在變量值里填上你python 存放路徑 我這存放在C盤 C:\Python35\Scripts\; C:\Python35\; 然后啟動命令行 win+r 里面輸入cmd 在彈出的黑框中輸入 python? 如下就表示安裝成功
下載Anaconda? 點擊這里?
安裝完成后
點擊 Anaconda Prompt? 打開后輸入
conda config --addchannels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --addchannels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
同樣在Anaconda Prompt中利用Anaconda創(chuàng)建一個python3.5的環(huán)境,環(huán)境名稱為tensorflow 旭从,輸入下面命令:
conda create -n tensorflow python=3.5
運行開始菜單->Anaconda3—>Anaconda Navigator,點擊左側(cè)的Environments,可以看到tensorflow的環(huán)境已經(jīng)創(chuàng)建好了馍忽。
在Anaconda Prompt中啟動tensorflow環(huán)境
安裝cpu版本的TensorFlow
pip install--upgrade--ignore-installed tensorflow
測試tensorflow
輸入 imprt tensorflow as tf??
這樣就安裝成功了
或者直接安裝
windows 安裝tensorflow
pip install --upgrade tensorflow
Windows 運行 Tensorflow 如果遇到這個報錯:
Error importing tensorflow.? Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.
或者在 Windows 運行的時候出現(xiàn)了如下報錯, 你需要安裝Windows 的 Visual C++ Redistributable for Visual Studio 2015就能成功解決問題.
https://www.microsoft.com/en-us/download/confirmation.aspx?id=48145