Gangmax Blog

How to Remove A Pip Package with Its Dependencies

From here and here.

If you want to remove some installed pip pacakge, most likely you also want to remove the pip packages it depends and installed with it. Unfortunately, “pip” itself doesn’t provide such option. However, you can still do this with some other useful pip packages, “pipdeptree“ and “pip-autoremove“.

1
2
pip install pip-autoremove
pip install pipdeptree

First you can run the following command to check the dependency tree of your current installed pip packages:

1
pipdeptree

If you want to remove some pip package and the ones it depends, you can run:

1
pip-autoremove ndfilter -y

Comments