I want to revert my Python install back to its base state so I can start using virtualenv
. Is there an easy way to uninstall only those packages that have been installed after Python was set up?
Uninstalling/removing Python packages using Pip Open a terminal window. To uninstall, or remove, a package use the command '$PIP uninstall <package-name>'. This example will remove the flask package.
pip is able to uninstall most installed packages.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With