13

I am using Python 2.7. I am trying to pip install a repo (on internal github) that has a dependency on another repo (also on internal github). I tried several options but the one that worked was like this:

(env)abc$ cat requirements.txt
 -e git://github.abc.com/abc/abc.git#egg=my_abc --process-dependency-links

(env)abc$ pip install -r requirements.txt

But I got a warning while running the command line that said:

"DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release."

I am on pip v7.1.2. What is the right way to do this?

Asclepius
  • 57,944
  • 17
  • 167
  • 143
Ankur Agarwal
  • 23,692
  • 41
  • 137
  • 208

2 Answers2

2

You can use PEP 508 URL requirements:

pip @ https://github.com/pypa/pip/archive/19.2.3.zip

They'll work for direct requirements (via the CLI, or listed in requirements.txt) and packages that aren't downloaded by pip from PyPI. Note that support for this was released in pip 18.0 (i.e. early 2018, because pip's on CalVer now).


In OP's case, the requirements.txt can be unchanged (though, they'd want to remove --process-dependency-links), if the dependency links are updated to the PEP 508 format.

pradyunsg
  • 18,287
  • 11
  • 43
  • 96
-1

Try using --process-dependency-links flag option. You might also have to use --allow-external packagename or --allow-unverified packagename, where packagename actually specifies whichever dependency you want to install that's not in an official repository

Note:Since it's deprecated functionality, the --process-dependency-links flag will be completely removed soon. I believe the preferred approach is to supply a requirements.txt file instead. For Example : Let i have certain requirements for my project, so i will write that in requirements.txt.

&cat requirements.txt

django-compressor>=1.4,<1.5
django-grappelli>=2.6.3,<2.7
django-bootstrap-form>=3.1,<3.2

Next i can install it using :

$ pip install -r requirements.txt

That's all you have to do

coder3521
  • 2,608
  • 1
  • 28
  • 50
  • 1
    Please see the edit above. I am already using requirements.txt with the contents shown in my original posting. What else do I need? – Ankur Agarwal Sep 22 '15 at 17:27
  • requirement.txt should contain all the dependent requirement , --process-dependency-links shouldn't be there , instead it should contain list of all dependent requirements . – coder3521 Sep 23 '15 at 04:45
  • i guess you may wish to accept it as an answer too. if it solved your purpose – coder3521 Sep 23 '15 at 06:51
  • 1
    @csharpcoder The stated preferred approach doesn't work because `pip` doesn't parse the requirements file recursively! In effect, the requirements of a requirement are not installed! – Asclepius Mar 08 '17 at 15:44