python私有仓库_python – 使用pip安装私有github仓库

序言,我已经看到这个问题

Is it possible to use pip to install a package from a private github repository?

我正在尝试从私人存储库安装一个包,我可以使用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被激活):

(myenv)robbie@ubuntu:~/git$ pip install git+https://git@github.com/matherbk/django-messages.gitDownloading/unpacking git+https://git@github.com/matherbk/django-messages.git

Cloning https://git@github.com/matherbk/django-messages.git to /tmp/pip-13ushS-build

Password for 'https://git@github.com':

fatal: Authentication failed

Complete output from command /usr/bin/git clone -q https://git@github.com/matherbk/django-messages.git /tmp/pip-13ushS-build:

----------------------------------------

Command /usr/bin/git clone -q https://git@github.com/matherbk/django-messages.git /tmp/pip-13ushS-build failed with error code 128 in None

Storing complete log in /home/robbie/.pip/pip.log

我尝试输入我的密码,但失败了。但是我已经通过git@github.com进行ssh认证:

(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来做第一个提到的文章,以便我不必将我的用户名添加到require.txt文件中,并将其添加到版本控制中。

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值