Is there a way to uninstall a package and all their dependencies through pip rather than uninstalling each dependency from my venv one by one? Or erasing my entire pip installs and then reinstalling the packages and dependencies that I want?
you may use pip-autoremove
this tool can remove package and its dependencies.
Is there a way to uninstall a package and all their dependencies through pip rather than uninstalling each dependency from my venv one by one?
I use this bash function
pipdepuninstall ()
{
pip install -q pipdeptree
pipdeptree -p$1 -fj | jq ".[] | .package.key" | xargs pip uninstall -y
}
This removes all dependencies of a package, and the package itself.
$ pip install Flask
$ pipdepuninstall Flask
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With