Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to uninstall a specific version of pip from my linux system?

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading