Python3 as default

Article Content


Most of the projects drop python2 support till 2020 year. You can read more there
That's why is highly recommend to switch to python3 as soon as possible.
This tutorial show how to install python3 on ubuntu and set as default version.


#check current default version
dominik@grind:~$ python -V
Python 2.7.12

#install python3
dominik@grind:~$ sudo apt-get install -y python3

#set python3 as default
dominik@grind:~$ update-alternatives --remove python /usr/bin/python2
dominik@grind:~$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
update-alternatives: using /usr/bin/python3 to provide /usr/bin/python (python) in auto mode

#check default version once again
dominik@grind:~$ python -V
Python 3.6.5
    

SubArticles


About

Added by dominik

Date: Aug. 5, 2018, 3:03 p.m.

Comments