我正在使用具有以下结构的仓库:
我正在尝试使用以下内容安装此软件包:
pip install git+ssh://git@github.com/owner/repo-namegit@commithash#egg=mypackage&subdirectory=foo/bar
然而,它只是挂在这里,似乎没有回应。
他们的documentation没有像这样的多个嵌套目录包路径的示例。但它确实说,强调我的:
对于setup.py不在项目根目录中的项目,使用“子目录”组件。 “子目录”组件的值应该是从项目的根目录到setup.py所在的路径
多个目录的pip正确形成的安装是什么样的?
以上是返回错误,例如:
Could not find a tag or branch 'commit', assuming commit.
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/var/folders/wf/89r2567s5hv48lj1g9l65mbw0000gp/T/pip-gAwA3W-build/setup.py'
我使用我测试的所有版本的pip(9.0.1和8.1.1)来看到这一点。
以下是详细日志:
$ pip install git+ssh://git@github.com/user/repo.git@hash#egg=projectname&subdirectory=lib/python
[1] 4195
Collecting projectname from git+ssh://git@github.com/user/repogit@hash#egg=projectname
Cloning ssh://git@github.com/user/repo.git (to 8d109c760ae8a9599299924be1b78645e2617a50) to /private/var/folders/wf/89r2567s5hv48lj1g9l65mbw0000gp/T/pip-build-w01D4G/repo
Could not find a tag or branch 'hash', assuming commit.
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/private/var/folders/wf/89r2567s5hv48lj1g9l65mbw0000gp/T/pip-build-w01D4G/repo/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/wf/89r2567s5hv48lj1g9l65mbw0000gp/T/pip-build-w01D4G/repo/
[1]+ Exit 1 pip install git+ssh://git@github.com/user/repo.git@hash#egg=projectname
看起来在我调用它的初始subdirectory
行之后,pip命令的那一部分正在消失?
答案 0 :(得分:6)
当使用带pip的多个运算符时,整个参数需要用引号括起来:
pip install git+ssh://git@github.com/owner/repo-name.git@commithash#"egg=mypackage&subdirectory=foo/bar"
否则,在&amp;并没有成功认识到这一点。