Ubuntu – Pip3 is pointing to the wrong version of python

pippython

I have installed python3.8 and have found no reference on how to get pip3 to talk to it on ubuntu. On macos I had explicitly installed pip3.8 and that has been crucial to getting all packages lined up correctly.

pip3 was installed as follows based on numerous recommendations:

    sudo apt-get install python3-pip

But it is pointing to python3.6:

$ pip3 -V
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

Please do not suggest anaconda or venv: there are reasons we are using directly installed python3.8.

Best Answer

  • The best option is to use python3 -m pip to run pip with a specific python version.

    The full docs on this are here: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/

  • Related Question