Question: I have a pip requirements file that changes during development.

Can `pip` be made to **uninstall** packages that do not appear in the requirements file as well as installing those that do appear? Is there a standard method?

This would allow the pip requirements file to be the canonical list of packages - an 'if and only if' approach.

**Update**: I suggested it as a new feature at <https://github.com/pypa/pip/issues/716>

Answer: 
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 <file>    Uninstall all the packages listed in the given requirements file.  This option can be
                              used multiple times.
...

```
It is possible now using:

```
pip uninstall -r requirements.txt

```