2017-08-01 26 views
2

當試圖在Anaconda上安裝Tensorflow時,我嘗試了兩種類型的命令。 conda install tensorflow-gpu工作得很好。但是,嘗試conda install -c anaconda tensorflow-gpu時,如here所示。它給出了以下錯誤消息。正確的安裝tensorflow命令

Fetching package metadata ... 
CondaHTTPError: HTTP None None for url <https://conda.anaconda.org/anaconda/linux-64/repodata.json> 
Elapsed: None 

An HTTP error occurred when trying to retrieve this URL. 
HTTP errors are often intermittent, and a simple retry will get you on your way. 
ConnectionError(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /anaconda/linux-64/repodata.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x2b8e3f4ec110>: Failed to establish a new connection: [Errno -2] Name or service not known',))",),) 

可能是什麼原因?

+1

你嘗試安裝再次 – ksai

+1

你的互聯網連接似乎是問題,請嘗試增加https超時! –

+0

您應該避免安裝anaconda版本,並在可能的情況下使用pip。 conda版本不受支持。 – JCooke

回答

1

一些誰可能不知道-c--channel選項添加channelconda搜索包。

請嘗試follwoing:

anaconda logout 
conda update conda 

不是嘗試重新安裝

也請看看官方web-site使用Anaconda安裝看到安裝TensorFlow的細節

2

存在兩種類型的張量流:

  1. TensorFlow與CPU只支持
  2. TensorFlow與GPU支持

你必須選擇通過安裝TensorFlow機制。支持的有如下幾種選擇:

  1. virtualenv

  2. using pip

  3. Docker

  4. Anaconda

我連鎖行業式步驟,通過使用PIP

安裝運行下面的終端

sudo apt-get install python-pip python-dev # for Python 2.7 
sudo apt-get install python3-pip python3-dev # for Python 3.n 

pip install tensorflow  # Python 2.7; for CPU support 
pip3 install tensorflow # Python 3.n; for CPU support 
pip install tensorflow-gpu # Python 2.7; for GPU support 
pip3 install tensorflow-gpu # Python 3.n; for GPU support 

卸載運行命令後在終端命令:

sudo pip uninstall tensorflow # for Python 2.7 
sudo pip3 uninstall tensorflow # for Python 3.n