Created
September 12, 2021 17:12
-
-
Save Glutexo/66a8a2768bef67a7e3e92245a42bf676 to your computer and use it in GitHub Desktop.
xonsh script to uninstall all pip packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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