centos 6.8 pip install error HTTPSHandler

时间:2016-12-06 05:06:30

标签: python linux django python-2.7 centos

你好,我有关于pip安装错误的问题 当我在终端中键入pip时,它会返回此消息

Traceback (most recent call last):
  File "/usr/local/python2.7//bin/pip", line 9, in <module>
    load_entry_point('pip==8.1.1', 'console_scripts', 'pip')()
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 542, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2569, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2229, in load
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2235, in resolve
  File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/__init__.py", line 16, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/vcs/subversion.py", line 9, in <module>
    from pip.index import Link
  File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/index.py", line 30, in <module>
    from pip.wheel import Wheel, wheel_ext
  File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/wheel.py", line 39, in <module>
    from pip._vendor.distlib.scripts import ScriptMaker
  File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/distlib/scripts.py", line 14, in <module>
    from .compat import sysconfig, detect_encoding, ZipFile
  File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.1.1-py2.7.egg/pip/_vendor/distlib/compat.py", line 31, in <module>
    from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

ImportError: cannot import name HTTPSHandler错误大部分时间是由于使用不支持SSL的Python解释器引起的。见Building Python with SSL support in non-standard location