Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTPSConnection module missing in Python 2.6 on CentOS 5.2

Tags:

python

centos

I'm playing around with a Python application on CentOS 5.2. It uses the Boto module to communicate with Amazon Web Services, which requires communication through a HTTPS connection.

When I try running my application I get an error regarding HTTPSConnection being missing: "AttributeError: 'module' object has no attribute 'HTTPSConnection'"

Google doesn't really return anything relevant, I've tried most of the solutions but none of them solve the problem.

Has anyone come across anything like it?

Here's the traceback:

Traceback (most recent call last):
File "./chatter.py", line 114, in <module>
    sys.exit(main())
File "./chatter.py", line 92, in main
    chatter.status( )
File "/mnt/application/chatter/__init__.py", line 161, in status
    cQueue.connect()
File "/mnt/application/chatter/tools.py", line 42, in connect
    self.connection = SQSConnection(cConfig.get("AWS", "KeyId"), cConfig.get("AWS", "AccessKey"));
File "/usr/local/lib/python2.6/site-packages/boto-1.7a-py2.6.egg/boto/sqs/connection.py", line 54, in __init__
    self.region.endpoint, debug, https_connection_factory)
File "/usr/local/lib/python2.6/site-packages/boto-1.7a-py2.6.egg/boto/connection.py", line 418, in __init__
    debug,  https_connection_factory)
File "/usr/local/lib/python2.6/site-packages/boto-1.7a-py2.6.egg/boto/connection.py", line 189, in __init__
    self.refresh_http_connection(self.server, self.is_secure)
File "/usr/local/lib/python2.6/site-packages/boto-1.7a-py2.6.egg/boto/connection.py", line 247, in refresh_http_connection
    connection = httplib.HTTPSConnection(host)
AttributeError: 'module' object has no attribute 'HTTPSConnection'
like image 350
d2kagw Avatar asked May 18 '09 10:05

d2kagw


2 Answers

citing from the python documentation (http://docs.python.org/library/httplib.html):

Note HTTPS support is only available if the socket module was compiled with SSL support.

You should find out how python on the CentOS you are using was built.

like image 156
jhwist Avatar answered Oct 14 '22 08:10

jhwist


Please install openssl and openssl-devel before you install python2.6.

You can simply install those packages using yum, and do a re-install of python2.6 (no need to remove already installed python2.6)

]# yum install openssl openssl-devel

Python-2.6.x]# ./configure
Python-2.6.x]# make && make altinstall
like image 45
andy Avatar answered Oct 14 '22 07:10

andy