Setting python version 3.8 as default Ubuntu 20.04

Currently when I run python3 --version the out put Python 3.9.1. I have been told that I need python version 3.8 to do what I want (use ros noetic without issues). I have tried to follow a couple of guides online to use python version 3.8, however, nothing works. I have even deleted 3.9.1 files but I still get the same output when checking the version. Don't really get how makes sense.

How can I set the default to 3.8 on Ubuntu 20.04?

Any help would be greatly appreciated!


Because you want to work with the ros noetic software, I think the best route is to set up an environment for it in Ubuntu 20.04.

Anaconda is a great way to create multiple software environments that require different packages and setups to make them work.

You can get started by downloading Anaconda (Individual Edition)

https://www.anaconda.com/products/individual

It can be a lengthy download, so allow some time for it to work.

When you get your command prompt again, please run this:

conda create --name ros python=3.8 anaconda

This sets aside an environment named ros that has python 3.8 as your base. It will also download and install a number of compatible tools that work well with python 3.8

To use this environment, you will need to activate it.

conda activate ros

Once you start working in this new environment, your terminal command line will be updated to show (ros) in the prompt.

Anaconda supports the Ros Noetic Desktop Full installation

https://anaconda.org/robostack/ros-noetic-desktop-full

and Ros Noetic Rosbag

https://anaconda.org/robostack/ros-noetic-rosbag

Each page gives you the command to run in your ros environment.

  • The beauty of this is you don't have to settle for one version of python on your system. You only really need it when you're trying to do robot os work. You can even open up another terminal and simultaneously do work in your default (non-conda environment) or activate several conda ros environments on your project.

  • I have several software projects (MongoDB, Superset, Flask web development) that have conflicting or overlapping needs. I make a conda environment for each one and never have to troubleshoot issues related to my software environment.