hi, Bob, that's not a good idea. First of all, Python 2.x codebases aren't necessarily cross-compatible with Python 3.x unless they have been written with future compatibility in mind. ```python using future module for cross-compatible between 2.x and 3.x from future import absoluteimport, division, printfunction ``` With that said, Python2.x was by default included as part of the Ubuntu installation for a reason, many system tools rely on it for compilation. By changing the default Python to 3.x, you're running into the risk of breaking many of these tools. Even setting up an alias is just a bad idea alias python = python3 though alias might seem like a small thing, in many cases, it'll do you no less harm than setting python3 as system default. For example, when running a shell script or Makefile, often they need to compile certain .py files by calling in the python command; if however the python has been aliased to python3, python3.x will be used instead, that can generate lots of compile-time errors. Is there any particular reason why you must set python3 as default in Ubuntu? Doing so may grant you the convenience of typing one less character, but it's totally not worth the potential risks. Answer from William Li on teamtreehouse.com
Discussions

Change default version of Python to 3.6
I have an R package that, under some circumstances, depends on the Python system installation. This currently seems to be 2.7. How can I set the default python version for an R project? Will you change the default version to 3.6 at some point? More on travis-ci.community
🌐 travis-ci.community
0
0
May 17, 2020
python - Permanently change the default Python3 version in Linux (Ubuntu on Windows) - Stack Overflow
This works: alias python='/usr... --version is Python 3.9.5 - but only temporarily, as upon closing and reopening Ubuntu it reverts to Python 3.8.10. I then tried creating a permanent alias by adding that same line to my .bashrc script (I followed these steps), and the same thing happened. ... How can I change the default Python 3.8 ... More on stackoverflow.com
🌐 stackoverflow.com
How to change Python and Pip version in Ubuntu
You shouldn’t tamper with the system installation of python and there really isn’t a way to “change the defaults” globally. You should look into virtual environments: https://docs.python.org/3/library/venv.html In short, create a virtual environment based on the global 3.9 installation and once activated it would point python to python3.9 for you until you deactivate it. More on reddit.com
🌐 r/bashonubuntuonwindows
11
14
January 17, 2021
Install python 3.11.9 on ubuntu
According to this page: 'Python 3.11.9 is the newest major release of the Python programming language". Can I install Python 3.11.9 in my Virtual Machine? I have installed guest VM ubuntu-22.04.4-desktop-amd64.iso on a Windows 10 host. In the VM, I have run the following: sudo apt install sudo ... More on discuss.python.org
🌐 discuss.python.org
12
1
April 16, 2024
🌐
Travis CI Community
travis-ci.community › languages
Change default version of Python to 3.6 - R - Travis CI Community
May 17, 2020 - I have an R package that, under some circumstances, depends on the Python system installation. This currently seems to be 2.7. How can I set the default python version for an R project? Will you change the default versio…
🌐
RoseHosting
rosehosting.com › home › how to install and switch python versions on ubuntu 20.04
How to Install and Switch Python Versions on Ubuntu 20.04 | RoseHosting
October 5, 2022 - This is the main purpose of the tutorial, to have multiple Python versions on a single system and have choices before creating the virtual environments or changing the default Python version. In the next steps, first we are going to install the default Python version in Ubuntu 20.04, and then ...
🌐
DEV Community
dev.to › toddbirchard › managing-multiple-versions-of-python-on-ubuntu-2004-2c3l
Managing Multiple Versions of Python on Ubuntu 20.04 - DEV Community
May 3, 2022 - Luckily for us, Ubuntu allows us to install additional (AKA: alternative) versions of Python by providing us with the make altinstall command: $ cd Python-3.9.2 $ sudo ./configure --enable-optimizations $ sudo make altinstall ... This may take a moment to complete. Once complete, you should see python3.9 in your /usr/local/bin/ directory: ... So, we now have two versions of Python installed on our machine: the system default Python 3.8.5 , and now our newly added Python 3.9.2.
🌐
Super User
superuser.com › questions › 608937 › setting-default-python-version-in-ubuntu
setting default python version in ubuntu - Super User
June 17, 2013 - tracked.py -V $PYTHON_VERSION -v \&\&\' && pycompile synthetic_data.py ... tracked.py -V $PYTHON_VERSION -v && sleep .001 && # Sorry cant remember why, wouldnt surprise me not existing reason at all rm python_version.foo && echo 'Compilation batchjob completed successfully' If this does not show the big picture then just think about how to make programs that behave according to what interpreters does each particular host have. This is somewhat old software, nowadays i would have done it asking for mktemp when using foofiles. God help me now. ... Instead of re-mapping internal python dependencies, change it temporarily and run the commands.
Find elsewhere
🌐
Baeldung
baeldung.com › home › administration › setting the default python to python3
Setting the Default python to python3 | Baeldung on Linux
May 7, 2025 - In this tutorial, let’s look at how to set the default Python in our system based on our preferred Python version. Most Linux distros usually have the latest stable release of Python included as the default, and in older systems, the deprecated Python2.* is the default. We’ll see how we can change the default Python using the alias and update-alternatives commands.
🌐
Medium
alluaravind1313.medium.com › make-python3-as-default-in-ubuntu-machine-572431b69094
Make Python3 as Default in Ubuntu Machine - ARAVIND ALLU - Medium
March 15, 2021 - Make Python3 as Default in Ubuntu Machine Install Python from the official Python-website. Before making the changes, we need to check the default version of python in the machine by using the …
🌐
KarChunT
karchunt.com › blog › setup-default-python-version-on-ubuntu
Setup Default Python Version on Ubuntu | KarChunT
Then, you can set the default Python version using the update-alternatives command. The higher the priority value, the higher the priority of that version. sudo update-alternatives --install /usr/bin/python3 python3 <replace-your-path> ...
🌐
MIT
web.mit.edu › 6.00 › www › handouts › pybuntu.html
Changing Default Python on Ubuntu
Setting python 2.6 as default on Linux · If you have a later version than 2.6 you'll need to set 2.6 as the default Python. Later versions would be 2.7 and 3.1; see what you have by typing python -V at the terminal. For purposes of this example we'll assume you have 3.1 installed.
🌐
OperaVPS
operavps.com › docs › how to change python default version in debian/ubuntu
How to Change Python Default Version in Debian/Ubuntu
February 12, 2026 - By using the update-alternatives command, you can prioritize the executable Python, and the version that has a high priority is set as the default version. By running the python -V command, the available version of Python will be displayed. ...
🌐
GitHub
github.com › pyenv › pyenv
GitHub - pyenv/pyenv: Simple Python version management · GitHub
Install Python build dependencies before attempting to install a new Python version. You can now begin using Pyenv. if you have upgraded from pyenv version 2.0.x-2.2.x ... The startup logic and instructions have been updated for simplicity in 2.3.0. The previous, more complicated configuration scheme for 2.0.0-2.2.5 still works. Define environment variable PYENV_ROOT to point to the path where Pyenv will store its data. $HOME/.pyenv is the default.
Starred by 44.5K users
Forked by 3.2K users
Languages   Shell 86.9% | Python 10.8% | Makefile 1.5% | C 0.4% | Roff 0.2% | Dockerfile 0.2%
🌐
Python.org
discuss.python.org › python help
Install python 3.11.9 on ubuntu - Python Help - Discussions on Python.org
According to this page: 'Python 3.11.9 is the newest major release of the Python programming language". Can I install Python 3.11.9 in my Virtual Machine? I have installed guest VM ubuntu-22.04.4-desktop-amd64.iso on a Windows 10 host. In the VM, I have run the following: sudo apt install sudo apt upgrade this: python3 --version returns: Python 3.10.12 When I run: sudo apt install python3 I receive this message: python3 is already at the newest version (3.10.6-1~22.04) When...
Published   April 16, 2024
🌐
Quora
quora.com › How-do-I-change-from-default-to-an-alternative-Python-version-on-Linux
How to change from default to an alternative Python version on Linux - Quora
pyenv manipulates PATH so the selected Python becomes default for that user/scope without touching system packages. ... Use pip to install packages. Deactivates to return to system Python. 2) update-alternatives (Debian/Ubuntu; system-wide, controlled) Install target Python packages from distro or deadsnakes PPA: sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt update · sudo apt install python3.11 python3.9 (or desired versions) ... Choose the desired candidate. Note: Changing /usr/bin/python may break system scripts expecting a specific Python version; prefer leaving /usr/bin/python3 alone and only use update-alternatives for /usr/bin/python if you understand distro implications.
🌐
LinuxConfig
linuxconfig.org › home › how to change from default to alternative python version on debian linux
How to change from default to alternative Python version on Debian Linux
December 7, 2023 - Open ~/.bashrc file and add new alias to change your default python executable: ... To change python version system-wide we can use update-alternatives python command.
🌐
Reddit
reddit.com › r/linux4noobs › changing default python version from python2 to python3 in ubuntu.
r/linux4noobs on Reddit: Changing default python version from python2 to python3 in ubuntu.
December 5, 2017 -

Does changing the default version from python 2 to python 3 in ubuntu using the following steps have any unwanted effects?

Step 1 — Making Python 3 the Default

In this step, we will set Python 3 as the default for our python command.

First, check your current Python version.

 python --version

On a fresh Ubuntu 17.10, this will output:

Python 2.7.6

We would like to have python run Python 3. So first, let's remove the old 2.7 binary.

 sudo rm /usr/bin/python

Next, create a symbolic link to the Python 3 binary in its place.

sudo ln -s /usr/bin/python3 /usr/bin/python

If you run python --version again, you will now see Python 3.6.3.

or should I just stick to

alias python=python3

in /.bashrc.

🌐
Reddit
reddit.com › r/linuxquestions › how to change python version in ubuntu?
r/linuxquestions on Reddit: How to change python version in Ubuntu?
October 13, 2025 -

I run Ubuntu 24.04 on my laptop and it came pre installed with python 3.12.3, but I want to change it to python 3.13.7. I tried doing it following chatgpt once, but after that I couldnt open the terminal and I had to change it back to 3.12.3 via the terminal in VS Code.
Is there a safe way to change it to 3.13 or should I just stick to 3.12?