从本地 SVN 签出安装 pip 包
我的 svn 存储库中有另一个 python 项目的克隆(有 setup.py 等)。我想安装告诉 pip 从这个目录安装。然而,它是一个内部 svn 存储库,可以通过 svn://
方案访问,而不是 http://
。
我可以像这样 svn co svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version ./foobar
那样检查目录,然后使用 pip 安装它: pip install foobar/
,但是我无法让它一次性完成所有操作。
以下是我尝试过的内容和输出:
pip install svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
...
File ".../virtualenv/lib/python2.5/site-packages/pip-0.7.2-py2.5.egg/pip/vcs/__init__.py", line 110, in get_url_rev
url = self.url.split('+', 1)[1]
IndexError: list index out of range
无论
pip install svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
...
File "...virtualenv/lib/python2.5/site-packages/distribute-0.6.10-py2.5.egg/pkg_resources.py", line 2424, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version', 'at', '+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version')
URL 末尾有或没有 #egg=packagename
,这两个问题都会发生(具有相同的错误消息)。
作为可编辑的 URL:
pip install -e svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package
Obtaining package from svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package
Checking out svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package to ../virtualenv/src/package
svn: URL 'svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package' is not properly URI-encoded
因此 SVN 会抱怨如果 url 末尾有 #egg=package
,并且如果我将其省略,则会收到此错误:
pip install -e svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
--editable=svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version is not the right format; it must have #egg=Package
How do I install a package from an SVN 与 pip 链接?
I have a clone of another python project (that has a setup.py etc.) in my svn repository. I want to install tell pip to install from this directory. However it's an internal svn repo and is accessible via the svn://
scheme, not http://
.
I can checkout the directory fine like so svn co svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version ./foobar
, then install it with pip: pip install foobar/
, however I can't make it do it all in one go.
Here is what I've tried and the output:
pip install svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
...
File ".../virtualenv/lib/python2.5/site-packages/pip-0.7.2-py2.5.egg/pip/vcs/__init__.py", line 110, in get_url_rev
url = self.url.split('+', 1)[1]
IndexError: list index out of range
and
pip install svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
...
File "...virtualenv/lib/python2.5/site-packages/distribute-0.6.10-py2.5.egg/pkg_resources.py", line 2424, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version', 'at', '+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version')
Both of these problems happen with or without #egg=packagename
at the end of the URL (with the same error message).
and as an editable URL:
pip install -e svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package
Obtaining package from svn+svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package
Checking out svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package to ../virtualenv/src/package
svn: URL 'svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version#egg=package' is not properly URI-encoded
So SVN complains if there's a #egg=package
at the end of the url, and if i leave it out, I get this error:
pip install -e svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version
--editable=svn://172.31.1.3/Development/Common/ThirdParty/Python/package/our-version is not the right format; it must have #egg=Package
How do I install a package from an SVN link with pip?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前这是一个未解决的错误。 Paul Nasrat 正在查看它并打开并发出。
遵循https://github.com/pypa/pip/issues/252
It is an open bug right now. Paul Nasrat is taking a look at it and opened and issue.
Follow the https://github.com/pypa/pip/issues/252