- Download the
pip_uninstall_all.py
file - Run
pip freeze | python pip_uninstall_all.py
You can also use a text files with the packages you wish to uninstall and provide em using stdin
#!/usr/bin/python | |
import sys | |
import os | |
packages = sys.stdin.readlines() | |
for package in packages: | |
package = package.strip().split('==')[0] | |
os.system('pip uninstall -y %s' % package) |