我无法更新ubuntu中的pip。我的ubuntu 14.04 64位,Python 3.6和anaconda3安装在我的机器上。我已使用以下命令更新pip。 sudo apt-get update 我尝试过以下解决方案 在etc / hosts中添加了以下内容 91.189.88.46 us.archive.ubuntu.com 91.189.88.46 security.ubuntu.com 91.189.88.46 * .ubuntu.com
But still getting the error as
Err http://extras.ubuntu.com trusty InRelease
Err http://extras.ubuntu.com trusty Release.gpg
Could not resolve 'extras.ubuntu.com'
Err http://archive.ubuntu.com trusty InRelease
Err http://archive.ubuntu.com trusty-updates InRelease
Err http://archive.ubuntu.com trusty-backports InRelease
Err http://archive.ubuntu.com trusty-security InRelease
Err http://archive.ubuntu.com trusty Release.gpg
Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/InRelease
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'extras.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Could not resolve 'archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
尝试运行命令pip install --upgrade pip但是它会抛出错误。
例外: Traceback(最近一次调用最后一次): 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/basecommand.py" ;,第215行,主要 status = self.run(options,args) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/commands/install.py" ;,第335行,在运行中 wb.build(自动建立=真) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/wheel.py" ;,第749行,在构建中 self.requirement_set.prepare_files(self.finder) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/req/req_set.py",第380行,在prepare_files中 ignore_dependencies = self.ignore_dependencies)) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/req/req_set.py",第487行,在_prepare_file中 req_to_install,finder) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/req/req_set.py" ;,第428行,_check_skip_installed req_to_install,upgrade_allowed) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/index.py",第465行,在find_requirement中 all_candidates = self.find_all_candidates(req.name) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/index.py",第423行,在find_all_candidates中 对于self._get_pages(url_locations,project_name)中的页面: 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/index.py",第568行,在_get_pages中 page = self._get_page(location) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/index.py",第683行,在_get_page 返回HTMLPage.get_page(link,session = self.session) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/index.py",第792行,在get_page中 " Cache-Control":" max-age = 600", 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/_vendor/requests/sessions.py" ;,第488行,获取 返回self.request(' GET',url,** kwargs) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/download.py",第386行,请求中 return super(PipSession,self).request(method,url,* args,** kwargs) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/_vendor/requests/sessions.py" ;,第475行,请求中 resp = self.send(prep,** send_kwargs) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/_vendor/requests/sessions.py" ;,第596行,发送 r = adapter.send(request,** kwargs) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/_vendor/cachecontrol/adapter.py" ;,第47行,发送 resp = super(CacheControlAdapter,self).send(request,** kw) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/_vendor/requests/adapters.py" ;,第390行,发送 conn = self.get_connection(request.url,proxies) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/_vendor/requests/adapters.py" ;,第290行,在get_connection中 proxy_manager = self.proxy_manager_for(proxy) 文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/_vendor/requests/adapters.py",第184行,在proxy_manager_for中 ** proxy_kwargs 在SOCKSProxyManager中的文件" /home/tcs/anaconda3/lib/python3.6/site-packages/pip/_vendor/requests/adapters.py" ;,第43行 提出InvalidSchema("缺少SOCKS支持的依赖关系。") pip._vendor.requests.exceptions.InvalidSchema:缺少SOCKS支持的依赖项。