pip使用報錯【cannot import name HTTPSHandler】。

python2.7,報錯以下:python

Traceback (most recent call last):linux

 File "/usr/local/bin/pip", line 9, in <module>python2.7

   load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()ide

 File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 378, in load_entry_pointui

 File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2566, in load_entry_pointurl

 File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2260, in loadspa

 File "/usr/local/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/__init__.py", line 10, in <module>ip

   from pip.util import get_installed_distributions, get_progssl

 File "/usr/local/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/util.py", line 17, in <module>get

   from pip.vendor.distlib import version

 File "/usr/local/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/vendor/distlib/version.py", line 13, in <module>

   from .compat import string_types

 File "/usr/local/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/vendor/distlib/compat.py", line 31, in <module>

   from urllib2 import (Request, urlopen, URLError, HTTPError,

ImportError: cannot import name HTTPSHandle


處理:yum安裝openssl和openssl-devel。而後從新編譯python。

相關文章
相關標籤/搜索