1. 程式人生 > >解決TensorFlow安裝問題: Could not find a version that satisfies the requirement tensorflow

解決TensorFlow安裝問題: Could not find a version that satisfies the requirement tensorflow

環境:win7 64  

Python版本:3.7.0

安裝過程中提示:Could not find a version that satisfies the requirement tensorflow,很是鬱悶啊,最後度娘了一下知道了就是因為Python版本的問題啊TensorFlow版本目前還不支援Python3.7版本。前幾天剛升級的3.7啊,哭暈在廁所~~~

解決辦法:

1、解除安裝,重新使用anaconda安裝對應3.6版本的Python。

2、將3.7版本的Python降級為3.6

本文使用的是第2種方法,降級。

開啟anaconda prompt:輸入如下程式碼:

conda install python=3.6

等待提示(y/n?)輸入:y

等待降級過程,大約15分鐘左右,會提示done

命令列輸入:python

提示Python版本降級為3.6.2了,下面進行TensorFlow的安裝。

(1)在anaconda prompt利用anaconda建立一個名為tensorflow的Python3.6環境

conda create -n tensorflow python=3.6

(2)啟動tensorflow環境:

activate tensorflow

當不使用tensorflow時,關閉tensorflow環境,命令為:deactivate

(3)安裝tensorflow:

cpu版本:pip install --ignore-installed --upgrade tensorflow

gpu版本:pip install --ignore-installed --upgrade tensorflow-gpu 注意gpu版先裝好cuda以及cudnn 
等待安裝完成。

我安裝的CPU版:

等待安裝完成。。。。。。。

(4)測試TensorFlow,切換到Python下:

 

如此,則安裝TensorFlow成功了。

TensorFlow安裝參考了朋友部落格:https://blog.csdn.net/lwplwf/article/details/54896088