0

Setup

A Python project I just cloned has a requirements.txt file with this as the following line:

-e git+https://github.com/<my_org>/shared.git@v0.3.21#egg=shared

I've never seen this before, but after reading this answer I see that -e basically means that shared is another project that belongs to my_org that I might be editing locally. (I'm not, but I do have access to that repository.)

Problem

The actual problem that I'm encountering is that when I run pip install -r requirements.txt I'm prompted to enter my git username and password. This doesn't work for me, even though I can successfully log into git with the same credentials. My organization uses 2FA so I'm not sure how that'd work anyway.

Just guessing, I tried changing to the URL to the git@github... address, which is what I've successfully done in the past when cloning repositories, but it appears that git+https is required in this case.

Question

What is the recommended approach to managing credentials w/ 2FA and what might I do to proceed installing my requirements.txt file?

wheresmycookie
  • 683
  • 3
  • 16
  • 39

1 Answers1

0

From pip's install documentation could use ssh instead of https:

-e git+ssh://github.com/<my_org>/shared.git@v0.3.21#egg=shared

Note that you will need to have proper ssh keys configured for your account.

Gonzalo Matheu
  • 8,984
  • 5
  • 35
  • 58