码迷,mamicode.com
首页 > 其他好文 > 详细

Debian (Jessie 8.0) 的修复pip AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

时间:2015-05-12 15:52:33      阅读:241      评论:0      收藏:0      [点我收藏+]

标签:python   pip   debian8   openssl   sslv3   

升级到最新的stable后,python的pip还是老的. 在安装一些包的时候,报错了

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
    ['__name__'])
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 22, in <module>
    import requests, six
  File "/usr/local/lib/python2.7/dist-packages/requests-2.4.3-py2.7.egg/requests/__init__.py", line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/requests-2.4.3-py2.7.egg/requests/packages/urllib3/contrib/pyopenssl.py", line 73, in <module>
    ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

原因是debian8的pip用了urllib3, 而urllib3使用了debian8的新编译的OpenSSL SSLv3版. 


修复很简单, 升级pip,

pip install requests==2.6.0

或者

easy_install --upgrade pip
然后就可以pip install 安装了

Debian (Jessie 8.0) 的修复pip AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

标签:python   pip   debian8   openssl   sslv3   

原文地址:http://blog.csdn.net/rainysia/article/details/45668635

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!