By default python on mostly ubuntu, there is python 2. We need to use python3 to run the python files with the latest version.
After research, I am come up with an easy solution to set python3 as a default on the ubuntu system.
Steps to Set Python3 as Default On ubuntu?
- 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 - All Done!
Oldest comments (13)
useful, thanks
Nice
Thanks
Thanks
Thanks, It was helpful for me.
Thank you!
Thanks a ton Brother!
Hello brother for me update alternative does not work it throws an error of symbolic link . Kindly help
Hello @muhusmanguj ,
Please type
which pythonand let me know response.
Cool solution...It worked thank you
Thanks~