invl/pip-autoremove

autoremove user-only packages

fcastilloec opened this issue · 1 comments

When running the command, it seems that all dependencies are being removed, including system ones (installed by the OS package manager).
It would be great to have an option/flag that will only uninstall user packages.

I had this issue as well when running pip-autoremove after installing packages with pip install --user. In case further information helps:

  • I installed the packages before installing pip-autoremove.
  • I got a permission error due to not running pip-autoremove with root.
  • If I had run it with root permissions, packages required by other packages would have been removed since pip-autoremove tried to install things that weren't newly installed with the package--It tried to remove everything else too. If that is too complex to solve, only installing --user packages as fcastilloec suggested (such as by having a --user option?) would at least reduce the impact: It would allow the command to run and run more safely (Though it may still grab too many, it wouldn't mess with the system).
  • To reproduce the problem, run python3 -m pip install --user --upgrade pip setuptools wheel (avoids pip 20.0.4 which only accepts spyder_kernels not spyder-kernels) then python3 -m pip install --user --upgrade spyder-kernels.