简体   繁体   中英

How to add git source in requirements.txt

I would like to install a certain package from a private git repository. This is possible using pip install git+<REPO_LINK> . However, I would like to pip install -r requirements.txt all of my packages at the same time without having to specify which one comes from Pypi and private repo.

I have tried adding a configuration in ~/.config/pip/pip.conf

[global]
find-links =
    git+<REPO_LINK>

but this happened when running pip install -r requirements.txt :

ERROR: Could not find a version that satisfies the requirement my-package==0.1

Thanks in advance.

I have found a solution for it at this doc .

pip install git+<REPO_LINK>#egg=<PACKAGE_NAME>

When I run pip freeze , the package I have just installed is printed like this:

git+<REPO_LINK>#egg=<PACKAGE_NAME>

So running pip install -r requirements.txt runs like a charm to install this specific package so as public ones from Pypi.

:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM