0

I forgot to activate a new conda environment,I created before, so I started installing the packages. Now my system is littered with packages. How do I clean this up? I only want my conda packages to be in the base environment and the ones I create. I checked How to clean local python environment of conda installs but that is of no help to me.

Fredrik Widerberg
  • 3,068
  • 10
  • 30
  • 42
kchawla-pi
  • 408
  • 5
  • 12

1 Answers1

0

Do you have pip installed? If so, run pip freeze and save the output to a file. Review the file, make sure there are no packages listed that you DO NOT WANT to remove. Now, write a script to read in that file to a list, only keeping the package names. Have python loop over that list and uninstall each entry.

Michael Ohlrogge
  • 10,559
  • 5
  • 48
  • 76
mikeg
  • 444
  • 3
  • 13