简体   繁体   中英

Installing a pip package from a local SVN checkout

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM