which python
shows nothing. The following command fixes the issue
/usr/bin$ sudo ln -s python3 python
But is it a common, safe solution?
which python
/usr/bin/python
which python
shows nothing. The following command fixes the issue
/usr/bin$ sudo ln -s python3 python
But is it a common, safe solution?
which python
/usr/bin/python
No, that's not safe or common at all.
python
refers topython2
, notpython3
See PEP 394 for all the details on what the 'python' command should symlink to. Don't stop at the 8-year-old first paragraph, read the entire history section to see how the recommendations have changed over time.
Older releases of Ubuntu (16.04 and older) include both Python2 and Python3 with the default install. Changing
python
on these releases may break your system quite terribly.Newer releases of Ubuntu (18.04 and newer) include only Python3 with the default install. However, Python2 is trivial to install (
sudo apt install python2
).Python2 will reach End of Life during 2020, according to PEP 373. However, changing
python
afterward is still not recommended at present.