【问题标题】:Facing issues while installing Tensorflow behind a proxy在代理后面安装 Tensorflow 时面临的问题
【发布时间】:2018-09-19 16:00:58
【问题描述】:

我目前正在使用 Python(版本:3.5.2 |Anaconda 4.2.0 (64-bit)|)。当我尝试安装 tensorflow 时,它抛出了一个错误。我不明白如何解决。以下是错误:

Collecting tensorflow
Cache entry deserialization failed, entry ignored
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after 
connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel 
connection failed: 407 Proxy Authentication Required',))': 
/simple/tensorflow/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after 
connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel 
connection failed: 407 Proxy Authentication Required',))': 
/simple/tensorflow/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after 
connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel 
connection failed: 407 Proxy Authentication Required',))': 
/simple/tensorflow/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after 
connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel 
connection failed: 407 Proxy Authentication Required',))': 
/simple/tensorflow/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after 
connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel 
connection failed: 407 Proxy Authentication Required',))': 
/simple/tensorflow/
Could not find a version that satisfies the requirement tensorflow (from 
versions: )
No matching distribution found for tensorflow
Cache entry deserialization failed, entry ignored

我没有任何互联网连接问题。谁能帮我解决这个问题。

【问题讨论】:

  • 如果您使用代理,您是否还为 conda 配置了代理,例如 conda.io/docs/user-guide/configuration/index.html
  • @tardis.. 是的,我做到了
  • 您好像忘记为代理配置用户名和密码?至少错误Proxy Authentication Required 似乎表明
  • @FlyingTeller..我现在收到一个错误“无法连接到repo.continuum.io/pkgs/pro/win-64 ProxyError:代理错误:找不到'https'的代理。有关如何操作的更多信息,请参阅conda.pydata.org/docs/…配置代理。” .实际上我对此完全陌生,您能指导我现在该怎么做吗??
  • 您必须提供更多信息。你在代理后面吗?您是否已经通过 http 和 https 为 conda/anaconda 配置了代理(不是 os 或 webbrowser 的代理)?如果是,怎么做?

标签: installation conda http-proxy


【解决方案1】:

要在代理后面安装 tensorflow,请按照以下步骤操作

第一步:设置环境变量

HTTP_PROXY = http://user:password@proxy:portnumber

HTTPS_PROXY = https://user:password@proxy:portnumber

第 2 步: 在 .condarc 文件中设置代理服务器。

在 /Users/username/.condarc 中的“.condarc”文件中,添加以下行

proxy_servers:
  http: http://user:password@proxy:portnumber
  https: https://user:password@proxy:portnumber

第 3 步:通过 Anaconda 安装(conda 提示符)

方法一:

打开conda提示符,通过以下命令创建新的安装环境

conda create -n tensorflow
activate tensorflow
conda install jupyter
conda install scipy
conda install tensorflow

方法二:

下载下列文件:

  1. tensorflow jar,名称为 win-64/tensorflow-1.3.0-py36_0.tar.bz2,来自link
  2. protobuf jar,名称为 win-64/protobuf-3.2.0-py36_0.tar.bz2,来自link
  3. repodata.json.bz2 来自link

现在在 conda 提示符下,移动到下载的目录并给出这些命令

conda install tensorflow-1.3.0-py36_0.tar.bz2
conda install protobuf-3.2.0-py36_0.tar.bz2

现在你都被方法1或方法2设置了。

要从 conda 提示符本身检查安装,请给出这些命令

python ####this will open python workspace from conda
import tensorflow as tf ####if running this didnt gave any error u r all set

注意: 如果任何 conda 命令不起作用(因为您在代理下),请给出以下命令:

conda config --set ssl_verify no
set NO_PROXY=continuum.io,anaconda.org

希望这会有所帮助:)

【讨论】:

    猜你喜欢
    • 2012-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-03
    相关资源
    最近更新 更多