pkg_resources.ResolutionError: Script 'scripts/ansible' not found

来源:6-3 Ansible主要配置文件介绍

二月十三

2018-02-14

安装ansible成功,有finish信息,ansible模块也可以导入,但是运行/opt/python2.7/bin/ansible --version 命令就报下面的错误


pkg_resources.ResolutionError: Script 'scripts/ansible' not found in metadata at '/opt/python2.7/lib/python2.7/site-packages/ansible-2.4.1.0-py2.7.egg-info'

//img.mukewang.com/szimg/5a83f1570001f17007360396.jpg

//img.mukewang.com/szimg/5a83f28200015c1007690305.jpg

写回答

1回答

二月十三

提问者

2018-02-14

根据github上的winsible: egg option to pip https://github.com/pjeby/winsible/issues?q=is%3Aissue+is%3Aclosed

Alternately, try the --egg option to pip, to request that ansible be installed as an egg. My guess is that the problem is that pip doesn't install the .egg-info/scripts directory when not installing as an egg. (IMO that would be a compatibility bug in pip and should probably be reported, if that's the case.)


$ pip uninstall ansible
$ pip install --egg ansible

ansible --version 正常运行了


0
0

Python+Django+Ansible Playbook自动化运维项目实战

【课程升级3.6版本】大牛全面践行DevOps,运维与开发间高效协作

861 学习 · 326 问题

查看课程