Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httplib.HTTPSConnection returns AttributeError: 'module' object has no attribute 'HTTPSConnection' #833

Closed
billyziege opened this issue Mar 8, 2013 · 5 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@billyziege
Copy link

I apologize if this is just my machine/a repeat issue, after downloading pip 1.3.1 (I just retried this), I get the following error:

Traceback (most recent call last):
File "/mnt/iscsi_speed/devel/pipeline/all_nodes_v4_env/bin/pip", line 8, in
load_entry_point('pip==1.3.1', 'console_scripts', 'pip')()
File "/mnt/iscsi_speed/devel/pipeline/all_nodes_v4_env/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 318, in load_entry_point
File "/mnt/iscsi_speed/devel/pipeline/all_nodes_v4_env/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 2221, in load_entry_point
File "/mnt/iscsi_speed/devel/pipeline/all_nodes_v4_env/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1954, in load
File "/mnt/iscsi_speed/devel/pipeline/all_nodes_v4_env/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/init.py", line 11, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/mnt/iscsi_speed/devel/pipeline/all_nodes_v4_env/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/vcs/mercurial.py", line 9, in
from pip.download import path_to_url2
File "/mnt/iscsi_speed/devel/pipeline/all_nodes_v4_env/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/download.py", line 72, in
class VerifiedHTTPSConnection(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'

I thought I read somewhere that httplib is replace by http.client, but I can no longer find the link. BTW, pip 1.2.1 works fine, so this seems to have been introduced.

@qwcode
Copy link
Contributor

qwcode commented Mar 9, 2013

python 2.7 should have httplib.HTTPSConnection http://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection)

can you run these 2 things and paste the results:

[...]/all_nodes_v4_env/bin/python -c "import sys; print sys.version_info"
[...]all_nodes_v4_env/bin/python -c "import httplib; print dir(httplib)"

@qwcode
Copy link
Contributor

qwcode commented Mar 9, 2013

internally, pip handles the difference between py2 and py3 using a backwardcompat package that performs like so:

if sys.version_info >= (3,):
    import http.client as httplib
else:
    import httplib

@Sawboo
Copy link

Sawboo commented Mar 14, 2013

If the 'openssl-devel' package is missing from your system before you compiled python, httplib won't have HTTPSconnection.

Use yum to install openssl-devel, then recompile python.

@qwcode
Copy link
Contributor

qwcode commented Mar 16, 2013

ok, thanks for posting the solution @Sawboo . closing this as a pip issue for now.
if this were to come up a lot, we could consider an import error to the user explaining what to do.

@gclsoft
Copy link

gclsoft commented Sep 21, 2015

ptyhon > 3.5 work for me

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

4 participants