How can I keep track of the packages when I install them using pip inside a virtualenv?
It seems like a mess now; if I install package A, it automatically install its dependancies; B, C and D. Then I decide to use package N instead which installs its dependancies as well.
Now when I remove package A, its dependancies are not automatically removed.
How I can keep my virtualenv clean? Is there a tool to check for unused packages and remove them?
To remove a package:
pip uninstall package_name
To get list of packages required by any given package (using pip):
pip show package_name
This will show you the packages that are required for it to run, and also the packages that require your package for them to run.
So the best way to uninstall a package with all its dependency packages is to run pip show package_name
first to see the list of its dependency packages and then uninstall it along with its dependency packages one by one. For example:
pip show package_name
pip uninstall package_name
pip uninstall dependency_package_1
pip uninstall dependency_package_2
...etc
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