標籤:Plan 開源 color pack anaconda code const tool ant
下載安裝Anaconda
首先下載Anaconda,可以從清華大學的鏡像網站進行下載。
安裝Anaconda,注意安裝時不要將添加環境變數的選項取消掉。
安裝完成之後,在安裝目錄下cmd,輸入
conda list
可以查看Anaconda為我們提供的Integration Environment:
下面只是一部分:
查看版本資訊:
conda --version
Anaconda 安裝成功。
接下來需要設定 Anaconda 倉庫鏡像,因為預設串連的是國外鏡像地址,下載速度比較慢,我們把鏡像地址改為清華大學開源軟體鏡像站,Anaconda Prompt 視窗輸入:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --set show_channel_urls yes
安裝 TensorFlow
繼續在 Anaconda Prompt 視窗輸入:
conda create -n tensorflow python=3.5
表示建立 TensorFlow 依賴環境,TensorFlow 目前不支援Python3.6,這裡我們使用Python3.5。
控制台輸出:
Fetching package metadata ...............Solving package specifications: .Package plan for installation in environment D:\Program Files\anaconda\envs\tensorflow:The following NEW packages will be INSTALLED: pip: 9.0.1-py35_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free python: 3.5.3-0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free setuptools: 27.2.0-py35_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free vs2015_runtime: 14.0.25123-0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free wheel: 0.29.0-py35_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/freeProceed ([y]/n)? y
提示我們安裝哪些依賴軟體,輸入‘y’,斷行符號。
安裝 CPU 版本:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ https://mirrors.tuna.tsinghua.edu.cn/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
啟用環境:
activate tensorflow
退出環境:
deactivate tensorflow
測試
進入到 Anaconda 安裝目錄下 /envs /tensorflow 檔案夾,繼續在 Anaconda Prompt 視窗輸入輸入:
python.exe
輸入:
>>> import tensorflow as tf>>> hello = tf.constant(‘Hello, TensorFlow!‘)>>> sess = tf.Session()>>> sess.run(hello)b‘Hello, TensorFlow!‘
Windows下Anaconda安裝 python + tensorflow