Ansible - Uninstall Ansible on Linux using pip

The pip3 show command can be used to determine if Ansible is installed.


There are 3 versions of pip

  • pip is used for Python version 2.6 and below
  • pip2 is used for Python version 2.7 and above
  • pip3 is used for Python version 3

For example, the /usr/bin/pip command (or just pip) would be used for Python version 2.6 and below.

pip3 show ansible


Something like this should be returned. In this example, Ansible version 2.9.12 is installed.

Name: ansible
Version: 2.9.12
Summary: Radically simple IT automation
Author: Ansible, Inc.
License: GPLv3+
Location: /root/.local/lib/python3.6/site-packages
Requires: jinja2, PyYAML, cryptography


The hash command caches the paths to commands, and if a command is relocated then bash will not pick it up unless that cache is cleared. Issue the following command to clear Ansible from the cache.

hash -d ansible


Use pip3 to uninstall ansible.

pip3 uninstall ansible


Something like this should be returned.

Found existing installation: ansible 2.9.12
Uninstalling ansible-2.9.12:
  Would remove:
  Would not remove (might be manually added):
Proceed (y/n)? y
  Successfully uninstalled ansible-2.9.12


The pip3 show command should now return something like this.

WARNING: Package(s) not found: ansible


Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter b4cf5 in the box below so that we can be sure you are a human.


August 1st, 2022 by Lavanya hema
Perfect solution. saved lot of time