正如标题所示,我试图从私有github仓库安装一个python包.对于公共存储库,我可以发出以下命令,该命令工作正常:
pip install git+git://github.com/django/django.git
Run Code Online (Sandbox Code Playgroud)
但是,如果我尝试使用私有存储库:
pip install git+git://github.com/echweb/echweb-utils.git
Run Code Online (Sandbox Code Playgroud)
我得到以下输出:
Downloading/unpacking git+git://github.com/echweb/echweb-utils.git
Cloning Git repository git://github.com/echweb/echweb-utils.git to /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-VRsIoo-build
Complete output from command /usr/local/bin/git clone git://github.com/echweb/echweb-utils.git /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-VRsIoo-build:
fatal: The remote end hung up unexpectedly
Cloning into /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-VRsIoo-build...
----------------------------------------
Command /usr/local/bin/git clone git://github.com/echweb/echweb-utils.git /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-VRsIoo-build failed with error code 128
Run Code Online (Sandbox Code Playgroud)
我想这是因为我试图访问私有存储库而不提供任何身份验证.因此我尝试使用git + ssh希望pip使用我的ssh公钥进行身份验证:
pip install git+ssh://github.com/echweb/echweb-utils.git
Run Code Online (Sandbox Code Playgroud)
这给出了以下输出:
Downloading/unpacking git+ssh://github.com/echweb/echweb-utils.git
Cloning Git repository ssh://github.com/echweb/echweb-utils.git to /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-DQB8s4-build
Complete output from command /usr/local/bin/git clone ssh://github.com/echweb/echweb-utils.git /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-DQB8s4-build:
Cloning into /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-DQB8s4-build...
Permission denied (publickey).
fatal: The remote end hung …Run Code Online (Sandbox Code Playgroud)