Skip to content

Instantly share code, notes, and snippets.

@Glutexo
Created September 12, 2021 17:12
Show Gist options
  • Save Glutexo/66a8a2768bef67a7e3e92245a42bf676 to your computer and use it in GitHub Desktop.
Save Glutexo/66a8a2768bef67a7e3e92245a42bf676 to your computer and use it in GitHub Desktop.
xonsh script to uninstall all pip packages
for line in $(pip freeze).split("\n"):
. try:
. package, _ = line.split("==")
. except ValueError:
. continue
. else:
. $(pip uninstall -y @(package))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment