pip报“Cannot connect to proxy”与“Failed to establish a new connection: [Errno 113] No route to host"案例

   日期:2024-01-17     浏览:53    评论:0    

在一台新的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使之生效,问题解决。

 
打赏
 本文转载自:网络 
所有权利归属于原作者,如文章来源标示错误或侵犯了您的权利请联系微信13520258486
更多>最近资讯中心
更多>最新资讯中心
0相关评论

推荐图文
推荐资讯中心
点击排行
最新信息
新手指南
采购商服务
供应商服务
交易安全
关注我们
手机网站:
新浪微博:
微信关注:

13520258486

周一至周五 9:00-18:00
(其他时间联系在线客服)

24小时在线客服