
Uninstall all pip packages at once
By:
evandrix on
Sep 5th, 2011 | syntax:
Bash | size: 0.41 KB | hits: 549 | expires: Never
#!/bin/bash
#if [ "$#" -ne 1 ]; then
# echo "Usage: $0 <py pkg name using \$(pip freeze -l)>"
# exit
#fi
for plugin in $(pip freeze -l); do
PLUGIN=$(echo "$plugin" | awk -F == '{print $1}')
echo "Uninstalling $PLUGIN..."
expect -c "spawn pip uninstall $PLUGIN
expect {
\"Proceed (y/n)?\" {
send \"y\r\n\"
expect {
exit
}
}
}"
done