Python安装软件包出错

系统 1731 0

转载请注明文章出处:https://tlanyan.me/python-ins...

今天用 pip 安装软件包,死活安装不上,出现如下错误:

          
            Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('
            
              : Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('
              
                : Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('
                
                  : Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('
                  
                    : Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('
                    
                      : Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl

Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl (Caused by NewConnectionError('
                      
                        : Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))


                      
                    
                  
                
              
            
          
        

还以为是特定软件包的问题,很快发现升级pip也有问题。

网上找了一圈,把代理、vpn等都关了,问题依旧。仔细看错误的最后一行,看到有 files.pythonhosted.org 这个域名,心想难道这个域名挂了?

ping这个域名,竟然提示解析错误。于是登陆到境外的服务器上ping,解析正常。想到应该是dns解析问题,接着把dns换成了 1.1.1.1 8.8.8.8 ,再次安装,问题顺利解决。


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论