I have a pip requirements file that changes during development.
Can pip
be made to uninstall packages that do not appear in the requirement
You can now pass the -r requirements.txt
argument to pip uninstall
.
pip uninstall -r requirements.txt -y
At least as of pip
8.1.2, pip help uninstall
shows:
...
Uninstall Options:
-r, --requirement Uninstall all the packages listed in the given requirements file. This option can be
used multiple times.
...