美文网首页
python安装库失败

python安装库失败

作者: seeiy | 来源:发表于2019-11-07 15:26 被阅读0次
    root@xxxx:/zy/xxe# python3 -m pip install certifi -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
    Looking in indexes: http://pypi.douban.com/simple/
    Collecting certifi
      WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0xb646308c>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/certifi/
      WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0xb646370c>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/certifi/
      WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0xb6463f4c>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/certifi/
      WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0xb63f75ac>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/certifi/
      WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0xb63f7f0c>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/certifi/
      ERROR: Could not find a version that satisfies the requirement certifi (from versions: none)
    ERROR: No matching distribution found for certifi
    
    

    最近老是遇到这个问题,刚开始以为是因为库在国外的原因,但是换到国内的源依然报这个错,之后才发现是因为linux的DNS服务的原因,最近公司的DNS服务器老是出问题,修改了linux的dns配置文件指定了8.8.8.8作为DNS服务器才正常安装。

    linuxDNS配置文件位置:

    /etc/resolv.conf
    

    格式:

    nameserver 8.8.8.8
    

    相关文章

      网友评论

          本文标题:python安装库失败

          本文链接:https://www.haomeiwen.com/subject/lhdvbctx.html