How to remove all packages installed by pip with a single command?

- 👤 Andrés Cruz

🇪🇸 En español

With a simple Python command, it is possible to uninstall all the packages that we have installed from a project or application:

pip freeze | xargs pip uninstall -y

We can use this command in a virtual environment of the venv perfectly; this solution is useful when we want to update a project with the latest dependencies.

I agree to receive announcements of interest about this Blog.

We will see how to uninstall all the packages of a project in Python.

| 👤 Andrés Cruz

🇪🇸 En español