Nur Pip installiert, aber ich kann es nicht importieren. OS ist RedHat Enterprise und ich habe auch die neueste openssl (kompiliert von der Quelle) installiert.ImportError: Name kann nicht importiert werden HTTPSHandler
$ easy_install pip
Searching for pip
Best match: pip 8.1.1
Adding pip 8.1.1 to easy-install.pth file
Installing pip script to XXX/local/bin
Installing pip3.5 script to XXX/local/bin
Installing pip3 script to XXX/local/bin
Using XXX/local/lib/python2.7/site-packages
Processing dependencies for pip
Finished processing dependencies for pip
$ python
Python 2.7 (r27:82500, Apr 27 2016, 15:32:43)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pip
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "XXX/local/lib/python2.7/site-packages/pip/__init__.py", line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "XXX/local/lib/python2.7/site-packages/pip/vcs/subversion.py", line 9, in <module>
from pip.index import Link
File "XXX/local/lib/python2.7/site-packages/pip/index.py", line 30, in <module>
from pip.wheel import Wheel, wheel_ext
File "XXX/local/lib/python2.7/site-packages/pip/wheel.py", line 39, in <module>
from pip._vendor.distlib.scripts import ScriptMaker
File "XXX/local/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", line 14, in <module>
from .compat import sysconfig, detect_encoding, ZipFile
File "XXX/local/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py", line 31, in <module>
from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler
Ich weiß, ich habe meine openssl in einer Weise zu gestalten, dass sie mit Python arbeitet (nach this). Dies ist, wie ich openssl konfiguriert, bevor ich es kompilieren:
# openssl-1.0.2g
./config --prefix=XXX/local \
--openssldir=XXX/local/etc/ssl \
--libdir=lib \
shared \
zlib-dynamic \
-LXXX/local/lib \
-IXXX/local/include
Python-Version 2.7
Vielleicht hilfreich für Sie: http://stackoverflow.com/questions/ 20688034/importerror-can not-importname-httpshandler-using-pip – Harpal