当尝试在Anaconda上安装Tensorflow时,我尝试了两种类型的命令。 conda install tensorflow-gpu
工作得很好。但是,如图here所示,尝试conda install -c anaconda tensorflow-gpu
时。它给出以下错误消息。
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',))",),)
有什么理由?
答案 0 :(得分:2)
有两种类型的张量流:
您必须选择安装TensorFlow的机制。支持的选择如下:
我使用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
答案 1 :(得分:1)
对于可能不知道-c
或--channel
选项的人,会为channel
添加conda
来搜索该包。
请尝试下面的内容:
anaconda logout
conda update conda
而不是尝试重新安装
另请查看官方web-site,了解使用TensorFlow
安装安装Anaconda
的具体信息