11

I decided to upgrade my Python version to 3.10 from 3.8 after I installed 3.10. I used:

sudo update-alternatives --config python3

and then selected the appropriate number designated for 3.10. But after I closed the terminal after changing the version, the terminal refused to open up. Thankfully, I reverted the version back using the terminal on my VS Code and it seemed to open up.

Why does this happen? I mean, we have to upgrade to the higher version for sure at some point of time. Is this an issue from the Ubuntu developers or is something wrong with my Ubuntu?

My specifications:

  • Shell: Bash
  • Terminal: Gnome Terminal
  • Ubuntu version: 20.04 LTS
wjandrea
  • 14,543

1 Answers1

20

Never change the default version of Python in Ubuntu!!

Thankfully, I reverted the version back using the terminal on my VS Code and it seemed to open up.

You could have also logged into a virtual terminal at ctrl + alt + f3 to change the Python version. Use ctrl + alt + f7 to get back to GUI.

Why does this happen?

The default software in Ubuntu heavily rely on the default Python version, and the default Python version in Ubuntu is not meant to be changed.

Is this an issue from the Ubuntu developers or is something wrong with my Ubuntu?

No, this is expected.

To use another version of Python, either call it with python3.10 (but don't symlink python3 with python3.10), or use virtual environments. You can also use Miniconda.

I mean, we have to upgrade to the higher version for sure at some point of time.

Not necessarily. Ubuntu supports the software in its repositories for quite some time (LTS releases are supported for 5 years). The point is, you don't need to upgrade to a later version of the operating system within this time frame.

If you always want to use the latest version of packages, you should use a rolling release distro instead.

wjandrea
  • 14,543