Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
可以使用pip在自托管gitlab中通过ssh安装包吗?_Ssh_Pip_Gitlab - Fatal编程技术网

可以使用pip在自托管gitlab中通过ssh安装包吗?

可以使用pip在自托管gitlab中通过ssh安装包吗?,ssh,pip,gitlab,Ssh,Pip,Gitlab,我有一个自托管的gitlab,我想安装一个使用ssh托管的包 我试过: pip install git+ssh://git@<my_domain>:se7entyse7en/<project_name>.git 正在清理。。。 命令/usr/local/bin/git clone-qssh://git@gitlab.com:loumarvincaraig/.git/var/folders/3r/v7swlvdn2p7_wyh9wj90td2m0000gn/T/pip-

我有一个自托管的gitlab,我想安装一个使用ssh托管的包

我试过:

pip install git+ssh://git@<my_domain>:se7entyse7en/<project_name>.git

正在清理。。。
命令/usr/local/bin/git clone-qssh://git@gitlab.com:loumarvincaraig/.git/var/folders/3r/v7swlvdn2p7_wyh9wj90td2m0000gn/T/pip-91JVFi-build失败,无错误代码128
例外信息:
回溯(最近一次呼叫最后一次):
文件“/Users/se7entyse7en/Envs/test/lib/python2.7/site packages/pip/basecommand.py”,主目录第134行
status=self.run(选项、参数)
文件“/Users/se7entyse7en/Envs/test/lib/python2.7/site-packages/pip/commands/install.py”,第236行,正在运行
需求设置准备文件(查找器,强制根目录,鸡蛋信息=self.bundle,bundle=self.bundle)
文件“/Users/se7entyse7en/Envs/test/lib/python2.7/site packages/pip/req.py”,第1092行,在prepare_文件中
self.unpack\u url(url、位置、self.is\u下载)
解包url中的文件“/Users/se7entyse7en/Envs/test/lib/python2.7/site packages/pip/req.py”,第1231行
返回解包vcs链接(链接,loc,仅下载)
文件“/Users/se7entyse7en/Envs/test/lib/python2.7/site packages/pip/download.py”,第410行,在unpack_vcs_链接中
vcs_后端。解包(位置)
文件“/Users/se7entyse7en/Envs/test/lib/python2.7/site packages/pip/vcs/_init__.py”,第240行,解包
自我获取(位置)
文件“/Users/se7entyse7en/Envs/test/lib/python2.7/site packages/pip/vcs/git.py”,第111行,获取
调用_子进程([self.cmd,'clone','-q',url,dest])
call_子流程中的文件“/Users/se7entyse7en/Envs/test/lib/python2.7/site packages/pip/util.py”,第670行
%(命令描述,过程返回代码,cwd))
安装错误:Command/usr/local/bin/git clone-qssh://git@gitlab.com:loumarvincaraig/.git/var/folders/3r/v7swlvdn2p7_wyh9wj90td2m0000gn/T/pip-91JVFi-build失败,无错误代码128

我不知道为什么,但通过运行以下命令,它起了作用(斜杠代替:after
):

pip安装git+ssh://git@/se7entyse7en/.git
#                                    ^
#斜杠代替:

是。这是默认用途:

pip安装git+ssh://git@:22/.git


冒号本身的使用意味着默认ssh端口号为22。因为您可以控制服务器的端口号,所以端口号可以不同。Git通过不提供
:22/
或仅提供
/
来实现定制。

明显的问题,但您的SSH是否适用于Git推送?你在gitlab.com上试过了吗?我们都可以在那里复制。是的,ssh正在为gitpush工作。我更新了答案。有人知道原因吗?@guemues有更多关于这个细节的信息。
Downloading/unpacking git+ssh://git@<my_domain>:se7entyse7en/<project_name>.git
Cloning ssh://git@<my_domain>:se7entyse7en/<project_name>.git to /var/folders/3r/v7swlvdn2p7_wyh9wj90td2m0000gn/T/pip-4_JdRU-build
ssh: Could not resolve hostname <my_domain>:se7entyse7en: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.
pip install git+ssh://git@gitlab.com:loumarvincaraig/<project_name>.git
/Users/se7entyse7en/Envs/test/bin/pip run on Mon Nov 17 22:14:51 2014
Downloading/unpacking git+ssh://git@gitlab.com:loumarvincaraig/<project_name>.git

Cloning ssh://git@gitlab.com:loumarvincaraig/<project_name>.git to /var/folders/3r/v7swlvdn2p7_wyh9wj90td2m0000gn/T/pip-91JVFi-build

Found command 'git' at '/usr/local/bin/git'
Running command /usr/local/bin/git clone -q ssh://git@gitlab.com:loumarvincaraig/<project_name>.git /var/folders/3r/v7swlvdn2p7_wyh9wj90td2m0000gn/T/pip-91JVFi-build
Complete output from command /usr/local/bin/git clone -q ssh://git@gitlab.com:loumarvincaraig/<project_name>.git /var/folders/3r/v7swlvdn2p7_wyh9wj90td2m0000gn/T/pip-91JVFi-build:
Cleaning up...

Command /usr/local/bin/git clone -q ssh://git@gitlab.com:loumarvincaraig/<project_name>.git /var/folders/3r/v7swlvdn2p7_wyh9wj90td2m0000gn/T/pip-91JVFi-build failed with error code 128 in None

Exception information:
Traceback (most recent call last):
File "/Users/se7entyse7en/Envs/test/lib/python2.7/site-packages/pip/basecommand.py", line 134, in main
status = self.run(options, args)
File "/Users/se7entyse7en/Envs/test/lib/python2.7/site-packages/pip/commands/install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/se7entyse7en/Envs/test/lib/python2.7/site-packages/pip/req.py", line 1092, in prepare_files
self.unpack_url(url, location, self.is_download)
File "/Users/se7entyse7en/Envs/test/lib/python2.7/site-packages/pip/req.py", line 1231, in unpack_url
return unpack_vcs_link(link, loc, only_download)
File "/Users/se7entyse7en/Envs/test/lib/python2.7/site-packages/pip/download.py", line 410, in unpack_vcs_link
vcs_backend.unpack(location)
File "/Users/se7entyse7en/Envs/test/lib/python2.7/site-packages/pip/vcs/__init__.py", line 240, in unpack
self.obtain(location)
File "/Users/se7entyse7en/Envs/test/lib/python2.7/site-packages/pip/vcs/git.py", line 111, in obtain
call_subprocess([self.cmd, 'clone', '-q', url, dest])
File "/Users/se7entyse7en/Envs/test/lib/python2.7/site-packages/pip/util.py", line 670, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/local/bin/git clone -q ssh://git@gitlab.com:loumarvincaraig/<project_name>.git /var/folders/3r/v7swlvdn2p7_wyh9wj90td2m0000gn/T/pip-91JVFi-build failed with error code 128 in None
pip install git+ssh://git@<my_domain>/se7entyse7en/<project_name>.git
#                                    ^
#                             slash instead of :