To update pip, I inadvertently ran pip3 install --upgrade pip, without sudo.
So I get this warning:
WARNING: The scripts pip, pip3, pip3.10 and pip3.11 are installed in '/home/myhome/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
So, I now have two versions of pip, one for the root and one for me:
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
pip 23.2.1 from /home/myhome/.local/lib/python3.10/site-packages/pip (python 3.10)
This is messy!
How to get rid of this newly and wrongly installed pip version?
>Solution :
There are some other options here, but you could also use python[version] -m pip uninstall pip, or /path/to/relevant/python -m pip uninstall pip, as in python3.10 -m pip uninstall pip or /usr/local/bin/python3 -m pip uninstall pip. You could also go to the appropriate directories and remove the files manually, as in rm ~/.local/bin/pip && rm -rf ~/.local/lib/python3.10/site-packages/pip. Or you could leave the extras and set your default, eg alias pip='/usr/local/bin/pip3' or a script in PATH that calls the correct version.