6

Is there a way to "reset" C:\Python26\Lib\site-packages? i.e. to remove all packages and modules installed either by setup.py install or using easy_install?

Motivation: something went wrong with all the package versions and dependencies and I rather reset and reinstall everything than spend the time in figuring out what it was exactly...

Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
  • You could just delete all the contents in the folder, although there may still be files in Tools/Scripts and other places left over. – ed. Sep 12 '11 at 12:41

3 Answers3

2

You could just delete all the contents in the folder, although there may still be files in Tools/Scripts and other places left over.

Have a look here:StackOverflow: uninstall a python package

Community
  • 1
  • 1
ed.
  • 1,373
  • 8
  • 10
  • Is simply deleting everything ok? – Jonathan Livni Sep 13 '11 at 05:08
  • Deleting things should be fine for the vast majority of cases. There may be the odd package that installs files outside site-packages, but it's pretty unlikely. – ed. Sep 13 '11 at 08:05
  • you should [uninstall everything](https://stackoverflow.com/a/11250821/3064538) with `pip freeze | xargs pip uninstall -y` before you delete `site-packages/`. – Boris Verkhovskiy Mar 03 '18 at 00:07
  • Where is site-packages located? (I need to remove a package from it as instructed [here](https://github.com/pypa/pip/issues/5247) but I cannot find it) – stevec Jun 14 '18 at 12:08
0

Does a simple rm -rf * in the site-packages directory do what you want, or do you want to leave some packages untouched?

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
0

Take a look at virtualenv for future reference.

Lewis Ellis
  • 208
  • 2
  • 7