使用pip命令

时间:2016-09-07 21:46:21

标签: python pip sni

出于某种原因,我无法使用pip在我的系统中安装或更新python包。 我收到了这个错误。

  

例外:

     

追踪(最近一次呼叫最后一次):

     

文件   " /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/basecommand.py" ;,   第209行,主要       status = self.run(options,args)

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/commands/install.py",   第299行,在运行中       requirement_set.prepare_files(取景器)

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_set.py",   第360行,在prepare_files中       ignore_dependencies = self.ignore_dependencies))

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_set.py",   第448行,在_prepare_file中       req_to_install,finder)

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_set.py",   第397行,在_check_skip_installed中       finder.find_requirement(req_to_install,self.upgrade)

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",   第41行,在find_requirement中       all_candidates = self.find_all_candidates(req.name)

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",   第398行,在find_all_candidates中       对于self._get_pages(url_locations,project_name)中的页面:

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",   第543行,在_get_pages中       page = self._get_page(location)

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",   第646行,在_get_page中       返回HTMLPage.get_page(link,session = self.session)

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py",   第755行,在get_page中       "缓存控制":" max-age = 600",

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/sessions.py",   第480行,在得到       返回self.request(' GET',url,** kwargs)

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/download.py",   第378行,请求中       return super(PipSession,self).request(method,url,* args,** kwargs)

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/sessions.py",   第468行,请求中       resp = self.send(prep,** send_kwargs)

     

File" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/sessions.py",   第576行,发送       r = adapter.send(request,** kwargs)

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/cachecontrol/adapter.py",   第46行,发送       resp = super(CacheControlAdapter,self).send(request,** kw)

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/adapters.py",   第376行,发送       超时=超时

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/connectionpool.py" ;,   第559行,在urlopen中       body = body,headers = headers)

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/connectionpool.py" ;,   第37行,在_make_request中       self._validate_conn(康涅狄格州)

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/connectionpool.py" ;,   第784行,在_validate_conn中       conn.connect()

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/connection.py" ;,第252行,在连接中       SSL_VERSION = resolved_ssl_version)

     

文件" /usr/local/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py& #34 ;,   第296行,在ssl_wrap_socket中       cnx.set_tlsext_host_name(server_hostname)

     

文件" build / bdist.linux-x86_64 / egg / OpenSSL / SSL.py",第423行,在爆炸中

raise NotImplementedError(error)   NotImplementedError: SNI not available

我尝试手动安装软件包pyOpenSSLndg-httpsclientpyasn1,但问题仍然存在。

我的系统是带有Python 2.7.3的RED HAT 4.1.2(服务器)

提前致谢

1 个答案:

答案 0 :(得分:0)

你的OpenSSL(不是pyOpenSSL)太旧了,你需要安装一个支持SNI的OpenSSL版本。