ansible安装遇到"AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'"的问题
2017-12-21 19:17
1151 查看
Ansible是时下比较流行的自动化运维工具,是用Python编写的。
我的系统是Ubuntu 16.04.3 LTS。
用以下命令安装:
$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible
安装过程是非常顺利的。但在测试运行:
$sudo ansible all -m ping
时,却遇到了:
AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'
的问题。在Overflow找到的解答,说这是urllib3 1.10前的版本造成的,但我的urllib是1.2版本。但Overflow上提供了强制升级requests的解决方案。
我查了以下已安装模块的版本:
python-apt (1.1.0b1)
python-dateutil (2.5.3)
python-debian (0.1.27)
python-editor (1.0)
pytz (2016.4)
pyxdg (0.25)
PyYAML (3.11)
requests (2.3.0)
scipy (0.17.0)
确实requests的版本是偏低的。首先卸载pyopenssl,然后:
pip install requests==2.6.0
然后重新安装pyopenssl。
再重新运行:
$sudo ansible all -m ping
显示:localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}
问题解决。
我的系统是Ubuntu 16.04.3 LTS。
用以下命令安装:
$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible
安装过程是非常顺利的。但在测试运行:
$sudo ansible all -m ping
时,却遇到了:
AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'
的问题。在Overflow找到的解答,说这是urllib3 1.10前的版本造成的,但我的urllib是1.2版本。但Overflow上提供了强制升级requests的解决方案。
我查了以下已安装模块的版本:
python-apt (1.1.0b1)
python-dateutil (2.5.3)
python-debian (0.1.27)
python-editor (1.0)
pytz (2016.4)
pyxdg (0.25)
PyYAML (3.11)
requests (2.3.0)
scipy (0.17.0)
确实requests的版本是偏低的。首先卸载pyopenssl,然后:
pip install requests==2.6.0
然后重新安装pyopenssl。
再重新运行:
$sudo ansible all -m ping
显示:localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}
问题解决。
相关文章推荐
- python遇到AttributeError: 'str' object has no attribute '_getAssertEqualityFunc'问题解决过程
- AttributeError: 'module' object has no attribute 'handlers'--Python子模块导入问题
- pygame安装问题(1) 'module' object has no attribute 'init'
- window安装uwsgi 遇到AttributeError: 'module' object has no attribute 'uname' 完美解决
- 【python学习笔记(2)】脚本报错"AttributeError: 'module' object has no attribute 'xxx'"解决方法
- 学习Python csv模块遇到AttributeError: module 'csv' has no attribute 'writer'和写入后出现空格问题
- Tensorflow protobuf版本报错问题解决(AttributeError: 'module' object has no attribute 'Default')
- pygame安装问题(1) 'module' object has no attribute 'init'
- Scrapy安装报错:AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'解决办法
- AttributeError 'module' object has no attribute 'handlers'--Python子模块导入问题
- 使用旧版本tensorflow出现了negative等报错的问题,AttributeError: 'module' object has no attribute 'xxx'"
- Debian (Jessie 8.0) 的修复pip AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'
- python错误:AttributeError: 'module' object has no attribute 'setdefaultencoding'问题的解决方法
- python错误:AttributeError: 'module' object has no attribute 'setdefaultencoding'问题的解决方法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 'Serial'
- openerp.cli.main() AttributeError: 'module' object has no attribute 'cli'
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- 使用cx_freeze工具打包时提示 AttributeError 'module' object has no attribute '_fix_up_module':