# pip - uninstall package with dependencies

DevFeed: [pip - uninstall package with dependencies](<https://devfeed.tech/articles/pip-uninstall-package-with-dependencies-27654.md>)

Original publisher: [Read original article](<https://gagor.pro/2016/04/pip-uninstall-package-with-dependencies/>)

Author: Tom

Published: 2016-04-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Gągor](<https://devfeed.tech/sources/tomasz-gagor.md>)

Topics: [pip](<https://devfeed.tech/topics/pip.md>), [Scripting, bash](<https://devfeed.tech/topics/scripting-bash.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [install](<https://devfeed.tech/tags/install.md>), [python](<https://devfeed.tech/tags/python.md>)

## AI overview

A Bash snippet recursively uninstalls a pip package and its dependencies, with a note that sudo may be needed depending on how the package was installed.

## Source excerpt

Virtualenvs in python are cheap but from time to time you will install something with pip on your system and when time comes removing all this crap could be difficult. I found this bash snippet1 that will uninstall package with all dependencies: Recursive pip uninstall for dep in $(pip show python-neutronclient | grep Requires | sed 's/Requires: //g; s/,//g') ; do pip uninstall -y $dep ; done pip uninstall -y python-neutronclient Depending how you installed it, you might need to use sudo.