Score:0

Setting python 3.9.4 as default

in flag

so i'm currently running ubuntu 20.04 on WSL2 (i'm also a newbie in linux) and i use python inside it, and recently i install python 3.9.4, is there's any way to remove python 3.8 and setting 3.9 as default ? i didn't try anything yet since idk much (yet) about linux especially ubuntu

Nmath avatar
ng flag
Many Ubuntu packages rely on python so it's not a good idea to change the version of python on your installed system. I would look into using a virtual environment or install Ubuntu in a VM like VirtualBox- that way you don't break your installed system.
guiverc avatar
cn flag
If you change the default python version - all tools that rely on python (which means the installed version of python) will cease to work; and your system will be a *rather* different one to what you've got now. Yes it will still function, but you have to use generic GNU/Linux tools as many higher level Ubuntu features will stop working (they use python & won't work without the versions they're designed for), so if you're a newbie - do **not** do it.
us flag
You can call it with `python3.9`.
Score:5
cn flag
  1. Do not change the default version of Python3 installed with Ubuntu.
  2. Do not change the version of Python3 that the python3 command points to -- keep it the system default.

Making either of those mistakes will break your Ubuntu system quite horribly. Your Ubuntu system makes extensive use of Python3, and is built against the specific version included. DON'T change it.

You CAN install other versions of Python3 in addition to the system default.

  • You cannot easily install additional versions of Python3 as deb packages. That's a limitation of how debs work.
  • You CAN use other methods: Conda and manual installs are two popular ways.
  • When you use different methods of installing software, it's YOUR job --as the human-- to keep track of what you installed, when, where, why, and how. Apt is deb-only and won't track other methods for you. Advice: Keep a journal.

If you must use a different version for python3, wrap that application inside a venv to protect your system from the customization.

Also, note that Ubuntu 20.04 was released before Python 3.9 became available. Newer releases of Ubuntu include Py3.9. Ubuntu is not like Windows in many ways -- for newer software, it's generally easier to run a newer release of Ubuntu rather than try to bolt new software onto an older release.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.