Ubuntu18.04 installs two versions Python2.7 and Python3.6 by default
$ ls /usr/bin/python*
1
Use update-alternatives to change the global Python version
$ update-alternatives --list python
1
If an error occurs: update-alternatives: error: no alternatives for python
$ update-alternatives --install /usr/bin/python python /usr/bin/python2.71
$ update-alternatives --install /usr/bin/python python /usr/bin/python3.62
1
2
The numbers
1and2at the end of the command indicate priority, and now use2by default
$ update-alternatives --config python
1
$ python --version
1
Recommended Posts