Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My main issue is that httplib module of python is missing HTTPSConnection.

When I try to use pip to install fabric using pip it gives me this error: 'module' object has no attribute 'HTTPSConnection'

I used easy_install and it worked for the most part but it also threw an error:

Download error: unknown url type: https -- Some packages may not be found!

This was my procedure for installing python2.7

sudo apt-get install build-essential
sudo apt-get install libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

tar –xvf Python-2.7.5.tgz
cd Python-2.7.5
./configure --enable-shared --prefix=/usr --sysconfdir=/etc
sudo make altinstall

Installed setuptools:

sudo sh setuptools-0.6c11-py2.7.egg

Installed pip:

curl -O
sudo python
share|improve this question
How did you install Python? It's in the repositories compiled with SSL support built-in. My best guess is that you left out some essential parts in your question. Please edit your question with some more information. I have the recent pip with HTTPS working perfectly well on Ubuntu 12.04 in a virtualenv and on the system wide installation. Nothing special required. – gertvdijk Jun 19 '13 at 19:14

I have to ask, why are you going through the hoops of building Python from source? I'm just curious. I understand it as a learning exercise maybe, but for most practical purposes (and especially if, as you show, you're doing a vanilla build with no modifications of stock Python) the packages included in Ubuntu work perfectly fine.

Apparently, in order for Python to build with SSL support, you need to uncomment some stuff in Modules/Setup.dist, before running ./configure. This begins on line 213 of Setup.dist:

# Socket module helper for socket(2)
#_socket socketmodule.c timemodule.c

# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#_ssl _ssl.c \
#   -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
#   -L$(SSL)/lib -lssl -lcrypto
# On Ubuntu, set SSL=/usr/ since /usr/include and /usr/include/openssl are there.
share|improve this answer
I need python 2.7. – mirsik Jun 19 '13 at 21:09
Thanks for the info @roadmr but it did not work. – mirsik Jun 19 '13 at 21:31
@user1996536 Python 2.7 is in the repositories for all supported Ubuntu versions (package: python2.7)... So again: why do you build from source? You're making it harder for yourself. – gertvdijk Jun 19 '13 at 22:24
@user1996536 you need to specify the correct location for SSL include directories in the SSL variable. Updating the answer to reflect this. – roadmr Jun 20 '13 at 15:26
I did provide the correct location SSL=/usr/lib/ssl – mirsik Jun 20 '13 at 16:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.