Reputation: 21
I recently installed python3.9.6 on ubuntu and it all seemed to work but when enter python3 on the terminal it shows python3.8.5, not python3.9.6 I want to type in python, python3, or python3.9 to open python3.9.6 can someone help me?
Upvotes: 0
Views: 8306
Reputation: 340
You could try adding a permanent alias:
Open your .bashrc file: vim ~/.bashrc
Add this to the end of the file:
alias sudo="sudo "
(credit to https://askubuntu.com/a/22043)
alias python="INSERT-PATH-TO-PYTHON-EXE-HERE"
alias python3="INSERT-PATH-TO-PYTHON-EXE-HERE"
alias python3.9="INSERT-PATH-TO-PYTHON-EXE-HERE"
source ~/.bashrc
Upvotes: 1
Reputation: 990
Check python version on terminal - python --version
Get root user privileges. On terminal type - sudo su
Write down the root user password.
Execute this command to switch to python 3.6.
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
Check python version - python --version
Upvotes: 2