zoukankan      html  css  js  c++  java
  • pip报“Cannot connect to proxy”与“Failed to establish a new connection: [Errno 113] No route to host"案例

    在一台新的Linux(CentOS 7.7)服务器上使用pip安装python包时遇到下面错误和告警,如下所示:

     

    # pip install pymssql
    WARNING: 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 0x7f8f866f3860>: Failed to establish a new connection: [Errno 113] No route to host',))': /simple/pymssql/
    WARNING: 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 0x7f8f8670d2b0>: Failed to establish a new connection: [Errno 113] No route to host',))': /simple/pymssql/
    WARNING: 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 0x7f8f8670d320>: Failed to establish a new connection: [Errno 113] No route to host',))': /simple/pymssql/
    WARNING: 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 0x7f8f866f3710>: Failed to establish a new connection: [Errno 113] No route to host',))': /simple/pymssql/
    WARNING: Retrying (Retry(total=0, 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 0x7f8f866f3518>: Failed to establish a new connection: [Errno 113] No route to host',))': /simple/pymssql/
    ERROR: Could not find a version that satisfies the requirement pymssql (from versions: none)
    ERROR: No matching distribution found for pymssql

     

    最后检查发现是因为代理弄错了。注意下面敏感信息做了混淆xxx.xxx.xxx.xxx代替了具体IP

     

    export http_proxy='http://xxx.xxx.xxx.xxx:3128'

    export https_proxy='http://xxx.xxx.xxx.xxx:3128'

     

    修改/etc/profile,更改设置,如下所示

     

    export http_proxy='http://xxx.xxx.xxx.xxx:3128'

    export https_proxy='https://xxx.xxx.xxx.xxx:3128'

     

    执行source /etc/profile使之生效,问题解决。

  • 相关阅读:
    SqlServer与Access之间的数据互导
    [转]半角<=>全角互转函数[JS版 VBS版]
    [文摘20070914]一个成功的博客必须知道的80个博客工具
    在javascript中获得由Ajax返回DataTable的列数和列名
    [转]获取xml节点值和属性值(兼容ie和firefox)
    [文摘20070920]网络战
    游标简单使用
    sql函数 得到 由 年月日时分秒+三位内的随机数 组成的随机数
    [转]ASP.NET 2.0 AJAX中Webservice调用方法示例 (包含参数类型为DataTable的WS方法)
    向页面中添加音乐或flash
  • 原文地址:https://www.cnblogs.com/kerrycode/p/13298852.html
Copyright © 2011-2022 走看看