1 min read
I want to change the default the version of python from 3.6 to 3.8 inside the terminal. How can I do that?
FreshlyBuilt Answered question February 23, 2020
1 min read
In this way, you can solve your doubts also.
Step1: Use the following command inside the terminal to change the installed version,
alias python='/usr/bin/python3.8'
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
file:
$ . ~/.bashrc
Step 3: Check your default python version:
$ python – version Python 3.8.1
FreshlyBuilt Answered question February 23, 2020
1 min read
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
update-alternatives
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.
Vishal Sharma Answered question February 17, 2020