9

Doing a pip install -r requirements.txt does not follow the order the modules are listed.

This answer points out how to do it.

I want to know how the order is determined by pip, and if the order is predictable in any way?

Roman
  • 8,826
  • 10
  • 63
  • 103
  • It follows package dependency. If package a in line 1 requires package x, then it will add package x which in turn may require package d. – alvits Jan 30 '19 at 20:00
  • @alvits Ah, I see. Looks like it is creating a dependency tree first and then starting at the leaves. It also looks like it installs git packages first. Any other rules you are aware of? – Roman Jan 30 '19 at 21:26
  • So if PIP is mentioned in the requirements.txt file, it will get installed 1st? – variable Jun 01 '20 at 07:30

0 Answers0