天天看點

anaconda 3 + tensorflow +keras 安裝步驟

最近重裝了一下anaconda3,相對應的一些安裝包tensorflow和keras都需要重新安裝,這裡我是直接用pip安裝在本機環境中的,作為一個電腦小白,發現這樣配置起來比較簡單,避免一些故障的發生:

第一步:下載下傳anaconda,官網下載下傳想要的版本。(我下載下傳的是Anaconda3-4.2.0-Windows-x86_64)

        下載下傳:官網下載下傳速度有點慢慢:https://www.anaconda.com/download/

                   清華鏡像:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

第二步:anaconda的安裝

1. 右擊 Anaconda3-4.2.0-Windows-x86_64,選擇以管理者身份運作,出現以下界面,點選Next.

anaconda 3 + tensorflow +keras 安裝步驟

  2. 接着點選I Agree.

anaconda 3 + tensorflow +keras 安裝步驟

3. Select Installation Type: Just me 還是 All Users. 視具體情況而定。如果電腦有多個使用者,則需要選擇All Users. 點選Next.

anaconda 3 + tensorflow +keras 安裝步驟

4. 選擇安裝路徑,我這裡選擇安裝在了D盤下面,盡量不要安裝在C槽,會占很多記憶體。選擇好之後點選Next.

anaconda 3 + tensorflow +keras 安裝步驟

5.  接着就到了Advanced  Installation Options,也就是所謂的進階選項,兩個都選擇上,點選Install.

             I 

anaconda 3 + tensorflow +keras 安裝步驟

6. 經過一段時間的安裝之後,終于安裝完成。

第三步:tensorflow的安裝

  1. 打開cmd視窗;
  2. 使用pip安裝,輸入指令行:pip install tensorflow. 系統會自動安裝tensorflow.出現以下問題

出現問題:

1. Cannot uninstall 'Werkzeug'. It is a distutils installed project and thus we cannot accurately determine which files belong to it      which would lead to only a partial uninstall. 解除安裝不了包。 

         輸入指令:pip uninstall Werkzeug 發現解除安裝不了 。

         解決方案:輸入指令conda uninstall Werkzeug,成功解除安裝;

         類似”Werkzeug“包是anaconda自帶的包,解除安裝需要用“conda”指令;而如果用pip下載下傳的話,需要用pip解除安裝。

2. 安裝tensorflow時出現setuptools版本過低,但是用pip upgrade setuptools無法進行更新,最後用pip install --upgrade --ignore-installed setuptools.完美解決。

anaconda 3 + tensorflow +keras 安裝步驟

3. 最後tensorflow安裝成功

第四步 Keras的安裝 

直接使用pip install keras進行安裝。

繼續閱讀