29

I was unaware that pip could be installed via my operating system's package manager, so I compiled and installed pip via source with the following command:

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | sudo python

I would like to uninstall pip, and instead install it from my operating system's package manager. How would I go about completely undoing the work of the installation script?

D.C. Rockwell
  • 292
  • 1
  • 3
  • 7

4 Answers4

76

pip uninstall pip will work  

Yogesh Mangaj
  • 3,200
  • 6
  • 32
  • 45
Karthikeyan D
  • 809
  • 1
  • 7
  • 8
14

That way you haven't installed pip, you installed just the easy_install i.e. setuptools.

First you should remove all the packages you installed with easy_install using (see uninstall):

easy_install -m PackageName

This includes pip if you installed it using easy_install pip.

After this you remove the setuptools following the instructions from here:

If setuptools package is found in your global site-packages directory, you may safely remove the following file/directory:

setuptools-*.egg

If setuptools is installed in some other location such as the user site directory (eg: ~/.local, ~/Library/Python or %APPDATA%), then you may safely remove the following files:

pkg_resources.py
easy_install.py
setuptools/
setuptools-*.egg-info/
vmrob
  • 2,966
  • 29
  • 40
Viktor Kerkez
  • 45,070
  • 12
  • 104
  • 85
  • 7
    What if you install pip using the `get-pip.py` file or something? – jpmc26 Dec 05 '14 at 21:26
  • @Viktor Kerkez, I am not able to uninstall pip. I used easy_install pip command. Now I wanted to downgrade pip version. how to unistall pip? – Prajna Hegde Feb 22 '18 at 11:22
8

If you installed pip like this:

 - sudo apt install python-pip
 - sudo apt install python3-pip

Uninstall them like this:

 - sudo apt remove python-pip
 - sudo apt remove python3-pip
vincedjango
  • 1,022
  • 1
  • 13
  • 24
3

I was using above command but it was not working. This command worked for me:

python -m pip uninstall pip setuptools
Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108