我与在CentOS 5.2 Python应用程序玩耍。 它使用宝途模块用Amazon Web Services,这需要通过HTTPS连接通信进行通信。

当我尝试运行我的应用程序获得关于HTTPSConnection是丢失的错误: “AttributeError的: '模块' 对象没有属性 'HTTPSConnection'”

谷歌并没有真正返回任何有关,我试了大部分的解决方案,但它们都没有解决问题。

有没有人碰到这样的事情?

这里的回溯:

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'
有帮助吗?

解决方案

这Python文档( http://docs.python.org/library/httplib援引。 HTML ):

注意 HTTPS支持仅如果套接字模块与支持SSL编译。

您应该找出如何蟒蛇在CentOS的你正在使用而建。

其他提示

在安装python2.6的之前,请安装OpenSSL和OpenSSL的-devel的。

您可以用yum只要安装这些程序包,并做了重新安装python2.6的(无需删除已安装python2.6的)的

]# yum install openssl openssl-devel

Python-2.6.x]# ./configure
Python-2.6.x]# make && make altinstall

你怎么了Python 2.6?在CentOS的2.4为标准配置,这可能是你的问题的原因。可能是值得重新安装博托作为库路径可能不正确

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top