在安裝python的pip工具時,遇到以下報錯[Errno -3] Temporary failure in name resolution',)': /simple/pip/
阿新 • • 發佈:2018-12-18
c/apt# pip2 install -U pip Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb9050>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/ Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb9190>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/ Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb92d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/ Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb9410>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/ Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb9550>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/
以上問題發現原來是DNS配置錯誤,域名伺服器地址是本機IP地址,127.0.0.1,所以修改域名伺服器
sudo gedit /etc/resolv.conf
nameserver 8.8.8.8
nameserver 114.114.114.114