I have downloaded Python 3.8 on my Ubuntu 16.04 and if i write python3.8
it shows it is present, but when I write python --version
I am getting my old Python version which was 3.5
Set an alias:
alias python=python3.8
Then running python
in Bash will run python3.8
.
To make the change permanent, put the alias line in ~/.bashrc
. It will take effect when you open Bash.
/usr/bin/python
to python3.8
?Ubuntu follows PEP 394 which says the python
command should point to Python 2. However an alias works since it only affects your shell. It doesn't even affect scripts you write, meaning if you want a script to run in Python 3.8, you'll have to write it explicitly in the shebang, e.g. #!/usr/bin/env python3.8
instead of #!/usr/bin/env python
.
/usr/bin/python3
to python3.8
?Some things will break since there are version-specific libraries. For example _gi
is not available for Python 3.8 on Ubuntu 16.04, so Gnome Terminal will not open. See Gnome terminal will not start on Ask Ubuntu for an example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With