Python 使用pip安装专用github存储库时出现问题

Python 使用pip安装专用github存储库时出现问题,python,git,github,virtualenv,pip,Python,Git,Github,Virtualenv,Pip,在前言中,我已经看到了这个问题 我正在尝试从我可以使用pip访问的私有存储库安装一个包 我可以像这样直接克隆它: (myenv)robbie@ubuntu:~/git$ git clone git@github.com:matherbk/django-messages.git Cloning into 'django-messages'... remote: Counting objects: 913, done. remote: Compressing objects: 100% (345/3

在前言中,我已经看到了这个问题

我正在尝试从我可以使用pip访问的私有存储库安装一个包

我可以像这样直接克隆它:

(myenv)robbie@ubuntu:~/git$ git clone git@github.com:matherbk/django-messages.git
Cloning into 'django-messages'...
remote: Counting objects: 913, done.
remote: Compressing objects: 100% (345/345), done.
remote: Total 913 (delta 504), reused 913 (delta 504)
Receiving objects: 100% (913/913), 165.73 KiB, done.
Resolving deltas: 100% (504/504), done.
但当我尝试通过pip安装它时(我的virtualenv被激活):

我试着输入密码,但失败了。不过,我是通过ssh身份验证的git@github.com:

(myenv)robbie@ubuntu:~/git$ ssh -T git@github.com
Hi robpodosek! You've successfully authenticated, but GitHub does not provide shell access.
我可以切换
git@github.com
robpodosek@github.com
它让我可以通过pip进行安装:

(myenv)robbie@ubuntu:~/git$ pip install git+https://robpodosek@github.com/matherbk/django-messages.git
Downloading/unpacking git+https://robpodosek@github.com/matherbk/django-messages.git
  Cloning https://robpodosek@github.com/matherbk/django-messages.git to /tmp/pip-SqEan9-build
Password for 'https://robpodosek@github.com': 
  Running setup.py egg_info for package from git+https://robpodosek@github.com/matherbk/django-messages.git

    warning: no files found matching 'README'
Installing collected packages: django-messages
  Running setup.py install for django-messages

    warning: no files found matching 'README'
Successfully installed django-messages
Cleaning up...
但是,我想使用git@github.com这样我就不必将用户名添加到requirements.txt文件中,并将其添加到版本控制中


有什么想法吗?我以前有这个工作,但必须启动一个新的形象。提前感谢。

通过使用oxyum的建议将其更改为:

pip install git+ssh://git@github.com/matherbk/django-messages.git

确保使用github.com
/account
而不是github.com
:account

请参见

已激活virtualenv,并且必须从github.com通过文本文件安装一系列应用程序

(venv)$ cat requirements.txt
-e git://github.com/boto/botocore.git@develop#egg=botocore
-e git://github.com/boto/jmespath.git@develop#egg=jmespath
-e git://github.com/boto/s3transfer.git@develop#egg=s3transfer
nose==1.3.3
mock==1.3.0
wheel==0.24.0
unittest2==0.5.1; python_version == '2.6'

(venv)$ pip install -r requirements.txt
Ignoring unittest2: markers 'python_version == "2.6"' don't match your environment Obtaining botocore from git+git://github.com/boto/botocore.git@develop#egg=botocore (from -r requirements.txt (line 1))
Cloning git://github.com/boto/botocore.git (to develop) to ./venv/src/botocore
fatal: unable to connect to github.com:
github.com[0: 192.30.253.112]: errno=Connection timed out
github.com[1: 192.30.253.113]: errno=Connection timed out

Command "git clone -q git://github.com/boto/botocore.git 
/home/ubuntu/utils/boto3/venv/src/botocore" failed with error code 128 in None
然而,正如@Robeezy所建议的,编辑requirement.txt并从

-e git://github.com...

这是从站点克隆时提供的链接(只有克隆或下载选项)


所以,谢谢你!它终于起作用了。

如果您使用
pip安装git进行安装+https://github.com/repo
如果收到此错误,请确保您的用户名和密码正确。我收到这个错误是因为我输入的密码不正确。

pip安装git+ssh://git@github.com/matherbk/django-messages.git?我出错是因为我在处理命令(在pdf中,存在hypen和dash问题)。。当我写命令的时候,它对我很有用…谢谢你给了我一个正确的答案。非常感谢。如何检查用户名和密码@如果没有你的帖子,维托伊永远不会注意到我的URI有什么问题。你救了我一天
-e git://github.com...
-e git+https://github.com...