I have installed python 3.6 in an Ubuntu 16.04 platform that had previously python 3.5
now if I check the installed version I have:
ls -l /usr/bin/python*
lrwxrwxrwx 1 root root 9 Nov 24 2017 /usr/bin/python -> python2.7
lrwxrwxrwx 1 root root 9 Nov 24 2017 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3492656 Nov 12 19:46 /usr/bin/python2.7
lrwxrwxrwx 1 root root 33 Nov 12 19:46 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root 16 Nov 24 2017 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root 9 Mar 23 2016 /usr/bin/python3 -> python3.5
-rwxr-xr-x 2 root root 4464368 Nov 12 16:27 /usr/bin/python3.5
-rwxr-xr-x 2 root root 4464368 Nov 12 16:27 /usr/bin/python3.5m
-rwxr-xr-x 2 root root 4719712 Dec 25 04:54 /usr/bin/python3.6
-rwxr-xr-x 2 root root 4719712 Dec 25 04:54 /usr/bin/python3.6m
lrwxrwxrwx 1 root root 10 Mar 23 2016 /usr/bin/python3m -> python3.5m
lrwxrwxrwx 1 root root 16 Nov 24 2017 /usr/bin/python-config -> python2.7-config
However if I check the version that is running is:
python3 --version
Python 3.5.2
The same in the jupyter notebook
How can I set Python 3.6.7
as default instead of Python 3.5.2
?
sudo update-alternatives --config python3
. – Jos May 09 '19 at 08:55python3
executable points to, that would break many applications. You can still manually run Python 3.6 with the commandpython3.6
instead ofpython3
, or you can make a Bash alias likealias py='python3.6'
if you want to save you some typing. – Byte Commander May 09 '19 at 09:25python3.6
if needed) – Byte Commander May 09 '19 at 09:50python='/usr/bin/python3.6?'
– emax May 09 '19 at 09:53py36
instead. But that is your choice, as it is only an alias, it will not effect anything but your interactive shells. – Byte Commander May 09 '19 at 10:00