uninstall all pip packages code example

Example 1: pip3 uninstall all

pip3 freeze | xargs pip3 uninstall -y

Example 2: delete all pip packages

#Write all modules to a txt file
pip freeze > requirements.txt

#Now to remove one by one:
pip uninstall -r requirements.txt

#If we want to remove all at once then:
pip uninstall -r requirements.txt -y

Example 3: uninstall package with pip

##in console write: pip uninstall 
pip uninstall 

Example 4: uninstall all pip packages anaconda

C:\> py -m pip uninstall simplejson
Uninstalling simplejson:
   /home/me/env/lib/python3.9/site-packages/simplejson
   /home/me/env/lib/python3.9/site-packages/simplejson-2.2.1-py3.9.egg-info
Proceed (y/n)? y
   Successfully uninstalled simplejson

Example 5: how to delete all pips

type "pip freeze" to get list of all installed packages.
Copy all the names into a text file name it pkg.txt
then type the following "pip uninstall -r pkg.txt"
you will be asked to proceed type "y" and enter

Example 6: uninstall all pip packages anaconda

py -m pip uninstall [options]  ...
py -m pip uninstall [options] -r  ...

Tags:

Misc Example