Sunday, 19 May 2019

Uninstall package in pip python

I've found this snippet as an alternative solution. It's a more graceful removal of libraries than remaking the virtualenv:

$ pip freeze | xargs pip uninstall -y

In case you have packages installed via VCS, you need to exclude those lines and remove the packages manually (elevated from the comments below):

$ pip freeze | grep -v "^-e" | xargs pip uninstall -y

Original answer: https://stackoverflow.com/questions/11248073/what-is-the-easiest-way-to-remove-all-packages-installed-by-pip

No comments:

Post a comment