HTTPSConnection module missing in Python 2.6 on CentOS 5.2(CentOS 5.2 上的 Python 2.6 中缺少 HTTPSConnection 模块)
问题描述
我正在 CentOS 5.2 上使用 Python 应用程序.它使用 Boto 模块与 Amazon Web Services 进行通信,这需要通过 HTTPS 连接进行通信.
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.
当我尝试运行我的应用程序时,我收到一个关于缺少 HTTPSConnection 的错误:"AttributeError: 'module' 对象没有属性 'HTTPSConnection'"
When I try running my application I get an error regarding HTTPSConnection being missing: "AttributeError: 'module' object has no attribute 'HTTPSConnection'"
Google 并没有真正返回任何相关信息,我已经尝试了大多数解决方案,但都没有解决问题.
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?
这是回溯:
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):
citing from the python documentation (http://docs.python.org/library/httplib.html):
注意 HTTPS 支持仅在套接字模块使用 SSL 支持编译时可用.
Note HTTPS support is only available if the socket module was compiled with SSL support.
您应该了解您使用的 CentOS 上的 python 是如何构建的.
You should find out how python on the CentOS you are using was built.
这篇关于CentOS 5.2 上的 Python 2.6 中缺少 HTTPSConnection 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:CentOS 5.2 上的 Python 2.6 中缺少 HTTPSConnection 模块
基础教程推荐
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 筛选NumPy数组 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01