Categories
Python Answers

How to remove all packages installed by pip with Python?

Spread the love

Sometimes, we want to remove all packages installed by pip with Python.

In this article, we’ll look at how to remove all packages installed by pip with Python.

How to remove all packages installed by pip with Python?

To remove all packages installed by pip with Python, we run pip uninstall.

To use it, we run

pip freeze | xargs pip uninstall -y

to run pip freeze to get the list of packages installed.

And then we pipe that to xargs pip uninstall -y to remove all the packages listed by pip freeze with pip uninstall.

We use the -y to remove everything without needing confirmation.

Conclusion

To remove all packages installed by pip with Python, we run pip uninstall.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *