tags:

views:

887

answers:

3

Hi guys,

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'
+2  A: 

Hi, 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.

jhwist
yeah right... i'll go digging and find the configure options
d2kagw
that was totally the issue, I found this link which runs through how enable the module: http://agiletesting.blogspot.com/2008/05/compiling-python-25-with-ssl-support.html
d2kagw
A: 

How come you have python 2.6? In CentOS 2.4 is standard, this might be the cause of your problem. Might be worth installing boto again as the library paths might not be correct

I need 2.6 due to the multiprocessing support
d2kagw
A: 

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 altinstal
andy