Tuesday, June 28, 2016

ImportError: cannot import name HTTPSHandler

If you encounter the following error:

$ python get-pip.py
Traceback (most recent call last):
  File "get-pip.py", line 19177, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
  File "/tmp/tmpI4QU87/pip.zip/pip/__init__.py", line 16, in <module>
  File "/tmp/tmpI4QU87/pip.zip/pip/vcs/subversion.py", line 9, in <module>
  File "/tmp/tmpI4QU87/pip.zip/pip/index.py", line 30, in <module>
  File "/tmp/tmpI4QU87/pip.zip/pip/wheel.py", line 39, in <module>
  File "/tmp/tmpI4QU87/pip.zip/pip/_vendor/distlib/scripts.py", line 14, in <module>
  File "/tmp/tmpI4QU87/pip.zip/pip/_vendor/distlib/compat.py", line 31, in <module>
ImportError: cannot import name HTTPSHandler
$

install `openssl-devel` as follows:

sudo yum install openssl-devel

and rebuild and install Python as follows:

./configure --prefix=/home/izeye/programs/python
make
make install

Reference:
http://stackoverflow.com/questions/20688034/importerror-cannot-import-name-httpshandler-using-pip

No comments:

Post a Comment