Question: I'm trying to fix up one of my virtualenvs - I'd like to reset all of the installed libraries back to the ones that match production.

Is there a quick and easy way to do this with pip?

Answer: 
Its an old question I know but I did stumble across it so for future reference you can now do this:

```
pip uninstall [options] <package> ...
pip uninstall [options] -r <requirements file> ...

```

> 
> -r, --requirement file 
> 
> 
> 
> > 
> > Uninstall all the packages listed in the given requirements file. This option can be used multiple times.
> > 
> > 
> > 
> 
> 
> 

from the [pip documentation](https://pip.pypa.io/en/stable/reference/pip_uninstall/) version 8.1
the easy robust way
cross-platform
and work in pipenv as well is:

```
pip freeze 
pip uninstall -r requirement

```

by pipenv:

```
pipenv run pip freeze 
pipenv run pip uninstall -r requirement

```

but won't update piplock or pipfile so be aware