在这个例子中,Django-cities失败了。
- hosts: localhost
tasks:
- name: Install Django
pip: name=Django
- name: Install Userena
pip: name=django-userena
- name: Install Django Messages
pip: name=https://github.com/arneb/django-messages/archive/master.zip
- name: Install Django Cities
pip: name=git+https://github.com/coderholic/django-cities.git@d0163f393e7557914b3f2c6882e740537ca63fd6错误:
TASK [Install Django Cities] ***************************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/bin/pip2 install -e git+https://github.com/coderholic/django-cities.git@d0163f393e7557914b3f2c6882e740537ca63fd6",
"failed": true, "msg": "\n:stderr: --editable=git+https://github.com/coderholic/django-cities.git@d0163f393e7557914b3f2c6882e740537ca63fd6 is not the right format; it must have #egg=Package\nYou are using pip version 8.1.2, however version 9.0.1 is available.\nYou should consider upgrading via the 'pip install --upgrade pip' command.\n"}
to retry, use: --limit @/root/cannablr/ansible/playbooks/installdjango.retry在Ansible中是否不允许通过pip安装git commit?
发布于 2017-01-14 07:21:30
如果在命令行上运行以下命令,您将得到相同的错误:
$ pip install -e git+https://github.com/coderholic/django-cities.git@d0163f393e7557914b3f2c6882e740537ca63fd6
--editable=git+https://github.com/coderholic/django-cities.git@d0163f393e7557914b3f2c6882e740537ca63fd6 is not the right format; it must have #egg=Package你可以添加一个#egg=packagename到它上面,它将会工作:
$ pip install -e git+https://github.com/coderholic/django-cities.git@d0163f393e7557914b3f2c6882e740537ca63fd6#egg=django-cities
Obtaining django-cities from git+https://github.com/coderholic/django-cities.git@d0163f393e7557914b3f2c6882e740537ca63fd6#egg=django-cities
Cloning https://github.com/coderholic/django-cities.git (to d0163f393e7557914b3f2c6882e740537ca63fd6) to src/django-cities因此,只需在Ansible中将#egg=django-cities添加到URL中,就可以了。
注意:我建议您引用您的git+https://....#egg=xyz yaml。里面有很多神奇的角色。
https://stackoverflow.com/questions/41643763
复制相似问题