linux代理设置引起的安装失败

  • 环境CentOS conda+Python3.6

最近客户提供了一个新CentOS系统让部署一个环境。费了好大劲才找到解决办法。
记录为证
参照:https://blog.csdn.net/weixin_44984664/article/details/108028704

  • wget 下载文件时
    提示:没有到主机的路由

[root@localhost ~]# wget https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
–2021-01-21 20:38:34-- https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
正在连接 192.168.1.222:8099… 失败:没有到主机的路由。
[root@localhost ~]#

  • pip安装包时
    提示:没有到主机的路由

[root@localhost ~]# pip install tensorflow
Collecting tensorflow
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProxyError(‘Cannot connect to proxy.’, NewConnectionError(’<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc5b976f630>: Failed to establish a new connection: [Errno 113] 没有到主机的路由’,))’: /simple/tensorflow/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProxyError(‘Cannot connect to proxy.’, NewConnectionError(’<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc5b976f780>: Failed to establish a new connection: [Errno 113] 没有到主机的路由’,))’: /simple/tensorflow/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProxyError(‘Cannot connect to proxy.’, NewConnectionError(’<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc5b976f358>: Failed to establish a new connection: [Errno 113] 没有到主机的路由’,))’: /simple/tensorflow/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProxyError(‘Cannot connect to proxy.’, NewConnectionError(’<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc5b976f5f8>: Failed to establish a new connection: [Errno 113] 没有到主机的路由’,))’: /simple/tensorflow/
^COperation cancelled by user


原因:设置了代理,代理没有权限。
解决方案:把代理关掉即可

  • 查看代理:

env|grep -i proxy
http_proxy=192.168.1.222:8099
https_proxy=192.168.1.222:8099

  • 临时窗口关掉代理:
    (关闭终端后元代理仍然存在)代理:

export http_proxy=""
export https_proxy=""

  • 设置代理:

export http_proxy=“192.168.1.222:8099”
export https_proxy=“192.168.1.222:8099”

  • 取消代理:

unset http_proxy
unset https_proxy

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值