【问题标题】:PIP install error with git repository packagesgit 存储库包的 PIP 安装错误
【发布时间】:2014-11-13 15:43:28
【问题描述】:

我现在需要部署一个旧的 django 项目。我需要安装此项目中使用的确切版本。

在这个项目的 requirements.txt 中有一些来自 GIT repos 的包。

在使用

安装这些要求时

pip install -r requirements.txt 抛出以下错误。

  File "/home/nyros/Desktop/new/rmkenv/local/lib/python2.7/site-packages/pip/req.py", line 70, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "/home/nyros/Desktop/new/rmkenv/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2606, in parse
    reqs = list(parse_requirements(s))
  File "/home/nyros/Desktop/new/rmkenv/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2544, in parse_requirements
    line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
  File "/home/nyros/Desktop/new/rmkenv/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2512, in scan_list
    raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'django_filebrowser-origin/HEAD', 'at', '/HEAD')

Storing debug log for failure in /home/nyros/.pip/pip.log

我认为问题出在 requirements.txt 中的 git urls 上。请检查以下 requirements.txt 并让我知道要修改什么以安装要求。

-e hg+https://bitbucket.org/descent/django-aloha@844a88f99fba4fd3e29771fe85d6c611e66cd2e5#egg=django_aloha-dev

-e git+https://github.com/Bouke/django-filebrowser-no-grappelli.git@a367570e795288281be303f7c2505803f7a48543#egg=django_filebrowser-origin/HEAD



-e git+https://github.com/toastdriven/django-haystack.git@4d90d7d6c77ebf7ee298f2de941b1f41d99caf1d#egg=django_haystack-master



-e git+https://github.com/jowolf/django-ide.git@a2aa7a8ae41298c4635ba6c8c3b634a130c653d9#egg=django_ide-master

-e git+https://github.com/bread-and-pepper/django-userena.git@5beff3929f261694f9af03f940e500586e2a60d3#egg=django_userena-origin/HEAD



-e git+https://github.com/pythonforfacebook/facebook-sdk@a12457671d3cb6265c52d9e8ef1ea2b387299fe3#egg=facebook_sdk-master

【问题讨论】:

  • 尝试用 git 替换 URL 中的 https!还要检查这些存储库是否仍然存在!
  • 我试过了,没用,@MudassirRazvi
  • 那些存储库存在,但 @ 提交不存在。
  • -e git+github.com/Bouke/… 尝试从 url 中删除 /HEAD
  • 我认为@serakiel 是正确的。具体来说,从每个 URL 的末尾删除 /HEAD#egg= 部分所在的位置。

标签: python django git pip


【解决方案1】:

从 github 导入特定提交的表单不需要 https,也不需要在导入结束时使用 /HEAD。请参阅以下 django 开发分支的导入:

-e git://github.com/django/django.git@8568e7cfa4fb87cd0a9ead1b3fbb7a39d19e98b9#egg=django

删除这些部分,看看是否能解决您的问题。

【讨论】:

  • 对这是否有助于您解决问题感兴趣。如果有,请随意给它打勾。
  • 感谢您的回答,但我的问题是 git url 末尾的 /HEAD。
  • 是的。在我的回答中,“它也不需要 /HEAD 在你的导入结束时。”这不是你需要的吗?
  • 是的,对不起@Pythagoras 我在你的评论中错过了 /head,我接受了你的回答,谢谢。
猜你喜欢
  • 2012-12-19
  • 2018-11-29
  • 1970-01-01
  • 2012-10-19
  • 2014-01-01
  • 1970-01-01
  • 2018-04-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多