序言,我已经看到这个问题
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文件中,并将其添加到版本控制中。
有什么想法吗?我以前有这个工作,但不得不启动一个新鲜的形象。提前感谢