I want to change the default the version of python from 3.6 to 3.8 inside the terminal. How can I do that?
In this way, you can solve your doubts also.
Step1: Use the following command inside the terminal to change the installed version,
To change a python version on per user basis you simply create an
alias within the user’s home directory. Open
~/.bashrc file and add a new alias to change your default python executable:
Step 2: Once you make the above change, re-login or source your
$ . ~/.bashrc
Step 3: Check your default python version:
$ python – version Python 3.8.1
Install Python 3.8
Steps to install Python3.8 and configure it as the default interpreter.
- Install the python3.8 package using apt-get
sudo apt-get install python3.8
- Add Python 3.8 to
sudo update-alternatives – install /usr/bin/python3 python3 /usr/bin/python3.8 1
- Now verify the version using the following command:
python – version
Hope that it will help you to solve the problem.