How do I remove all packages installed by PIP?

The following command should do the trick:

pip freeze > requirements.txt && pip uninstall -r requirements.txt -y

Alternatively you can skip the creation of any intermediate files (i.e. requirements.txt):

pip uninstall -y -r <(pip freeze)

Leave a Comment