Install subset of packages listed in a requirements.txt file with PIP

754 Views Asked by At

I'm wondering if it's possible to install a subset of the packages listed in a requirements file using the PIP CLI command or do I have to wrangle stuff in a makefile to get something like this?

pip install -r [package1, package2] requirements.txt

Regards

1

There are 1 best solutions below

1
On BEST ANSWER

Not sure it would do exactly what you have in mind, but you could try something like:

python -m pip install Something Another --constraint requirements.txt

See pip' documentation section on constraints files.