Skip to content

Instantly share code, notes, and snippets.

@mancap314
Created April 3, 2022 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mancap314/6ff7fb7af4255caf5b130392087db168 to your computer and use it in GitHub Desktop.
Save mancap314/6ff7fb7af4255caf5b130392087db168 to your computer and use it in GitHub Desktop.
Uninstalling all libraries in Python
#!/bin/bash
# shell script for removing all libraries installes
# could be useful for building a clean virtual environment on top of it
input="requirements.txt"
pip freeze > "${input}"
while IFS= read -r line; do
arrline=(${line//==/ })
pip uninstall -y ${arrline[0]}
done < "${input}"
rm "${input}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment