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
最近老是遇到這個(gè)問(wèn)題勋拟,剛開(kāi)始以為是因?yàn)閹?kù)在國(guó)外的原因光酣,但是換到國(guó)內(nèi)的源依然報(bào)這個(gè)錯(cuò),之后才發(fā)現(xiàn)是因?yàn)閘inux的DNS服務(wù)的原因提揍,最近公司的DNS服務(wù)器老是出問(wèn)題,修改了linux的dns配置文件指定了8.8.8.8作為DNS服務(wù)器才正常安裝煮仇。
linuxDNS配置文件位置:
/etc/resolv.conf
格式:
nameserver 8.8.8.8