python安裝庫(kù)失敗

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

linuxDNS配置文件位置:

/etc/resolv.conf

格式:

nameserver 8.8.8.8
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容