0

I have python 3.8 as the default install with ubuntu 20.04.

I have upgraded to python 3.11.

However, if i do pip3 --version is see this:

pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

In windows i just do pip install <package> and i want to achieve the same level of simplicity in ubuntu.

How to get this to upgrade too (python 3.11) or whatever the latest version of python is in Ubuntu ?

D.L
  • 4,339
  • 5
  • 22
  • 45
  • 1
    you can use `python3.11 -m pip install ` – sahasrara62 Feb 08 '23 at 19:40
  • to echo @sahasrara62, I __only__ ever use `pip` via `python -m`. I find there are just too many chances for things to be pointing to an unexpected environment otherwise. – JonSG Feb 08 '23 at 19:42
  • @sahasrara62, this is what i currently do. But i just want pip to point to the latest version. I dont care for previous (legacy) versions. Hence the specific question. – D.L Feb 08 '23 at 19:44
  • @JonSG, i hear what you say, but i remove previous (legacy) environments from the system. – D.L Feb 08 '23 at 19:45
  • 1
    @D.L `alias pip=python3.11 -m pip` add this in `~/.bashrc` and then do `source ~/.bashrc` , then you can use pip directly – sahasrara62 Feb 08 '23 at 19:46
  • How exactly did you "upgrade" to Python 3.11? Do you mean you installed it in parallel? Using Apt? From the regular repos? How did you configure your shell to prefer 3.11? – tripleee Feb 08 '23 at 19:47
  • @tripleee, yes, that is correct. – D.L Feb 08 '23 at 19:48
  • How did you configure your shell to prefer 3.11? – tripleee Feb 08 '23 at 19:51
  • @sahasrara62, i came across this method, but it means that if an upgrade is done, then the user needs to remember to upgrade the alias. Whereas the question requires the latest version (so `max(version)`), if such exists. – D.L Feb 08 '23 at 19:51
  • it still work with ubuntu upgrade – sahasrara62 Feb 08 '23 at 19:58
  • @tripleee, i followed a guide like this (https://stackoverflow.com/questions/41986507/unable-to-set-default-python-version-to-python3-in-ubuntu). – D.L Feb 08 '23 at 20:08
  • https://river.me/blog/change-pip-version/ is definitely confused but the stuff near the end is potentially useful. – tripleee Feb 08 '23 at 20:21

0 Answers0