To add a Git dependency:
pip install git+https://github.com/account/repo@tag#egg=package_name
or
pip install git+ssh://[email protected]/account/repo@tag#egg=package_name
git+https
or git+ssh
means: "This is a Git repositry, access to it using https or ssh protocol respectively". See pip install VSC Support.
Note that the part after git+
and before @
is the same as if you do git clone
using the HTTPS protocol and almost the same for the SSH protocol. For example, you could do:
git clone https://github.com/account/repo
Note, however, that for the SSH protocol the git clone
operation looks like this:
git clone [email protected]:account/repo
Compare it with the command that pip uses and see this subtle difference: with pip you have to split the account and repo name with the slash, not the colon.
Git tag
can be replaced with a branch name or commit, e.g.
pip install git+ssh://[email protected]/account/repo@master#egg=package_name
The part after pip install
can be added to requirements.txt
.
If you want to switch to another tag, branch, or commit, use the --upgrade
(or its short form -U
) flag, e.g.
pip install --upgrade git+ssh://[email protected]/account/repo@new_tag#egg=package_name
The same works for requirements.txt
:
pip install --upgrade -r requirements.txt
See also: