pip uninstall pip will work
pip uninstall pip will work
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):
Copyeasy_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:
Copysetuptools-*.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:
Copypkg_resources.py
easy_install.py
setuptools/
setuptools-*.egg-info/
In order to remove it type:
sudo apt-get remove python-pip python-dev
If you're not sure which switch to use, you can add the --help switch to almost if not every Linux command to get details about the command.
Example:
apt-get --help
to fully remove those you can use
sudo apt purge python-pip python-dev <-- this will delete all the files/directories/binaries created by that package
rhel - Unable to install/uninstall pip - Linux - Unix & Linux Stack Exchange
linux - how to uninstall pip from /usr/local/bin/ - Unix & Linux Stack Exchange
easy install - How to cleanly remove pip that is installed by using easy_install? - Stack Overflow
linux - can't remove python pip - Stack Overflow
Videos
(2) Are from snap
corepackage and you have 3 versions installed: 6130, 6259, 6350They don't interfere with system wide programs, they are only used for other snap packages.
(3) It is a locally installed Python2, that will take priority and better to get rid of it if you don't need it.
If you still have the downloaded source, use the uninstall command. If not then you have to make manual remove.
apt-get / apt (side-note: no actual difference of the two, see What is the difference between apt and apt-get?) is independent from the individual packages you might install (which is logical at second sight). See apt-get install for different python versions. That is on purpose.
pip2.7
+++EDIT: It seems that the solution for pip does not work, since I got a "Permission denied" after really executing the example commands.+++ Also see this that has no answer.
If you want to uninstall an old pip, you should use
python2.7 -m pip uninstall pip for getting rid of pip2.7 (for example).
and yes, "pip2.7 can uninstall pip2.7", this as a proof:
~/myfoldername $ pip -V
pip 20.3.1 from /home/myusername/myfoldername/venv/myvirtualenvironment/lib/python2.7/site-packages/pip (python 2.7)
~/myfoldername $ python2.7 -m pip uninstall pip
DEPRECATION: Python 2.7 reached the end of its life on January 1st,
2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. Found existing installation: pip 20.3.1 Uninstalling pip-20.3.1:
Would remove:
/home/myusername/myprojectname/venv/myvirtualenvironment/bin/pip
/home/myusername/myprojectname/venv/myvirtualenvironment/bin/pip-2.7
/home/myusername/myprojectname/venv/myvirtualenvironment/bin/pip2
/home/myusername/myprojectname/venv/myvirtualenvironment/bin/pip2.7
/home/myusername/myprojectname/venv/myvirtualenvironment/lib/python2.7/site-packages/pip-20.3.1.dist-info/*
/home/myusername/myprojectname/venv/myvirtualenvironment/lib/python2.7/site-packages/pip-20.3.1.virtualenv
/home/myusername/myprojectname/venv/myvirtualenvironment/lib/python2.7/site-packages/pip/*
Proceed (y/n)? n
pip3.7
~/myprojectname $ python3.7 -m pip uninstall pip
Found existing installation: pip 20.3.3 Uninstalling pip-20.3.3: Would remove:
/home/myusername/.local/bin/pip
/home/myusername/.local/bin/pip3
/home/myusername/.local/bin/pip3.7
/home/myusername/.local/lib/python3.7/site-packages/pip-20.3.3.dist-info/*
/home/myusername/.local/lib/python3.7/site-packages/pip/*
Proceed (y/n)? n
python2.7
Of course, that is not possible for python itself, you need: sudo apt-get remove python2.7
~/myfoldername $ sudo apt-get remove python2.7
0 upgraded, 2 newly installed, 402 to remove and 1 not upgraded.
Need to get 97,3 kB of archives.
After this operation, 387 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?] n
Abort.
Use pip to uninstall pip:
sudo pip uninstall pip
From this link:
easy_install -mxN <PackageName>
That means, execute:
easy_install -mxN pip
Then, you can manually remove the .egg files or directories, that should be located somewhere in .../Python/2.7/site-packages/[PACKAGE].egg.
You also check the similar question How do I remove packages installed with Python's easy_install?
Hey guys, i have a question
i didn't realize that using sudo with pip was bad practice, and i used it a long time ago so i couldn't even remember what i had installed with it (i had some stuff installed as --user and some as root). I wasn't sure what to do so i ended up completely deleting /usr/lib/python2.7 and 3.9, afterwards many of my programs refused to work, so i ended up basically reinstalling every package in my system, and its working good so far.
Now, did deleting /usr/lib/python* get rid of all the pip files, or would i still be missing something?.
1 MONTH LATER EDIT: about a month later, i was reinstalling the same pip packages i had before but without using pip, and pacman complained about files already existing, so i had to delete some python files from /usr/bin i believe
Ubuntu Oneiric (and I expect newer versions too) install pip packages to /usr/local/lib/python2.7/dist-packages, and apt packages to /usr/lib/python2.7/dist-packages. So just check the former directory and sudo pip uninstall every package you find there.
Pip currently ignores uninstall commands that try to uninstall something owned by the OS. It doesn't error out, like it does with a missing package. So, now you can uninstall with the following process:
pip freeze > dump.txt
Edit the dumped file to remove any -e "editable install" lines, everything after the == sign (%s;==.*;;g in vim), swap the new lines for spaces (%s;\n; ;g in vim). Then you can uninstall all un-owned packages with
cat dump.txt | xargs sudo pip uninstall -y
I had to do this procedure twice, because a few packages were installed in ~/.local/lib too.
A one-liner to accomplish this:
pip freeze | grep -vP '^(?:#|-e\s)' | sed 's;==.*;;g' | xargs -r sudo pip uninstall -y