DEV Community

Cover image for Change the Python3 default Version in Ubuntu
Sohail Ahmed
Sohail Ahmed

Posted on

Change the Python3 default Version in Ubuntu

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!

Top comments (13)

Collapse
 
sadjosarai profile image
sadjo L saraï •

useful, thanks

Collapse
 
rigeldeveloper profile image
Jhonathan Andres Mauricio La torre •

Nice

Collapse
 
dionisiodev profile image
Dionisio •

Thanks

Collapse
 
selqthang profile image
SELQThang •

Thanks

Collapse
 
reajulhasanraju profile image
Reajul Hasan Raju •

Thanks, It was helpful for me.

Collapse
 
abby9224 profile image
Abdullah •

Thank you!

Collapse
 
syfulsharif_68 profile image
Syful Sharif •

Thanks a ton Brother!

Collapse
 
defender007 profile image
Defender007 •

Cool solution...It worked thank you

Collapse
 
digisal profile image
digiSal •

thank you!

Collapse
 
sauravkumarjhanitw profile image
SauravKumarJhaNITW •

helpful !