How can I define multiple requirement files?

You can have one file "include" the other; for example, if you put this in file2.txt:

-r file1.txt
Django
Flask
etc.

Then when you do pip install -r file2.txt, it will also install things from file1.txt.

I often use this strategy to have a "base" requirements file, and then only specify those things that are required at each stage (development, testing, staging, production, etc.)


pip accepts multiple -r arguments:

pip install -r reqs1.txt -r reqs2.txt

The help for pip install says:

-r, --requirement
Install from the given requirements file. This option can be used multiple times.