-2

I am updating python to 3.8. After following some tutorials when I type:

python --version

I get

Python 3.7.4

If I type:

python3.8 --version

I get

Python 3.8.12

How can I get the python --version to say that I am using 3.8 ??

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
  • 1
    Which OS & version? Can you give us more details about "some tutorial"? – pLumo Feb 21 '22 at 12:18
  • Ubuntu 18.04. The tutorials: https://tech.serhatteker.com/post/2019-12/how-to-install-python38-on-ubuntu/ and https://www.itsupportwale.com/blog/how-to-upgrade-to-python-3-8-on-ubuntu-18-04-lts/ – error404 Feb 21 '22 at 12:20

1 Answers1

4

When you need python 3.8, call it with python3.8.


You should not change the default python3.6 in Ubuntu 18.04. Otherwise, you may experience a lot of problems.

Run

sudo update-alternatives --config python3

And choose python3.6. You can also choose 3.8 here (at your own risk), but it may lead to nasty issues like this.

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212