I've just now installed Python 3.7 and I'd like to understand why I get the following output from bash:
g-luca@hp-notebook:~$ python3.7 -V
Python 3.7.0
g-luca@hp-notebook:~$ python3 -V
Python 3.5.2
g-luca@hp-notebook:~$ python -V
Python 2.7.12
I've just now installed Python 3.7 and I'd like to understand why I get the following output from bash:
g-luca@hp-notebook:~$ python3.7 -V
Python 3.7.0
g-luca@hp-notebook:~$ python3 -V
Python 3.5.2
g-luca@hp-notebook:~$ python -V
Python 2.7.12
You need to check which symlinks are in place. The Python binaries are located in the directory /usr/bin
(check with which pythonX.Y
). The python3
symlink points to the python3.5
binary.
As mentioned in the comments: if you don't want to type python3.7
every time you shouldn't change the symlink. Changing the Python version might brake system stuff in unexpected ways. You should rather create an alias in your shell. In Bash you would add something like alias python=python3.7
into ~/.bashrc
.
/usr/bin
and Python3.7 at/usr/local/bin
.which python
says/usr/bin
that is why Python3.7 is not the default one. The reason why starts Python2.7 instead of Pyhton3.5 installed in same folder, should reside in the symlinks, am I right? – glc78 Sep 29 '18 at 14:14/usr/bin/python
is a symlink to/usr/bin/python2.7
, therefore this is the default. – Sethos II Sep 30 '18 at 09:34