首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过Ansible Playbook对特定git提交的Pip安装失败

通过Ansible Playbook对特定git提交的Pip安装失败
EN

Stack Overflow用户
提问于 2017-01-14 05:32:04
回答 1查看 250关注 0票数 1

在这个例子中,Django-cities失败了。

代码语言:javascript
复制
- 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

错误:

代码语言:javascript
复制
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?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-14 07:21:30

如果在命令行上运行以下命令,您将得到相同的错误:

代码语言:javascript
复制
$ 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到它上面,它将会工作:

代码语言:javascript
复制
$ 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。里面有很多神奇的角色。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41643763

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档