Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
tar –xvf Python-2.7.5.tgz
cd Python-2.7.5
./configure --enable-shared --prefix=/usr --sysconfdir=/etc
make
sudo make altinstall

Installed setuptools:

wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
sudo sh setuptools-0.6c11-py2.7.egg

Installed pip:

curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
share|improve this question
1  
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

1 Answer 1

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
# ^^^^ UNCOMMENT THIS LINE

# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
#_ssl _ssl.c \
#   -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
#   -L$(SSL)/lib -lssl -lcrypto
# ^^^^ UNCOMMENT PREVIOUS 4 LINES
# On Ubuntu, set SSL=/usr/ since /usr/include and /usr/include/openssl are there.
share|improve this answer
    
I need python 2.7. –  user1996536 Jun 19 '13 at 21:09
    
Thanks for the info @roadmr but it did not work. –  user1996536 Jun 19 '13 at 21:31
1  
@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 –  user1996536 Jun 20 '13 at 16:10

Your Answer

 
discard

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.