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?
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?
The quickest way is to remake the virtualenv completely. I'm assuming you have a requirements.txt file that matches production, if not:
For Windows users, this is what I use on Windows PowerShell
pip freeze
command to a .txt file.pip uninstall -r *textfile.txt*
Using virtualenvwrapper function:
See wipeenv documentation
I think this works with the latest
In my case, I had accidentally installed a number of packages globally using a Homebrew-installed
pip
on macOS. The easiest way to revert to the default packages was a simple:Or, if you were using
pip3
: