pip install 命令报如下错误
Collecting labelmeUsing cached /packages/79/a4/01b9500bc62e6930157a37f2fb2522c1797ffa0ad70684a805ec9fa0df6e/labelme-4.5.7.tar.gzCollecting imgviz>=0.11.0 (from labelme)Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef0dd6e4e0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/e9/71/a57677fcac28dce37869d1798ce1ca3bde44e9eabe016eed928187b888dc/imgviz-1.2.6.tar.gzRetrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef0dd6e7f0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/e9/71/a57677fcac28dce37869d1798ce1ca3bde44e9eabe016eed928187b888dc/imgviz-1.2.6.tar.gzRetrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef0dd6e860>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/e9/71/a57677fcac28dce37869d1798ce1ca3bde44e9eabe016eed928187b888dc/imgviz-1.2.6.tar.gzRetrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef0dd6e630>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/e9/71/a57677fcac28dce37869d1798ce1ca3bde44e9eabe016eed928187b888dc/imgviz-1.2.6.tar.gzRetrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef0dd6ea58>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/e9/71/a57677fcac28dce37869d1798ce1ca3bde44e9eabe016eed928187b888dc/imgviz-1.2.6.tar.gzException:Traceback (most recent call last):File "/home/wjw/anaconda3/envs/labelme/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connection.py", line 142, in _new_conn(self.host, self.port), self.timeout, **extra_kw)File "/home/wjw/anaconda3/envs/labelme/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py", line 75, in create_connectionfor res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):File "/home/wjw/anaconda3/envs/labelme/lib/python3.6/socket.py", line 745, in getaddrinfofor res in _socket.getaddrinfo(host, port, family, type, proto, flags):socket.gaierror: [Errno -3] Temporary failure in name resolution
在/etc/resolv.conf文件中添加如下两行,可正常安装
执行命令:
sudo vi /etc/resolv.conf
nameserver 8.8.8.8nameserver 114.114.114.114