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
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityYou 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?
/usr/bin/python
is a symlink to /usr/bin/python2.7
, therefore this is the default.
Sep 30, 2018 at 9:34