Unable to set default python version to python3 in ubuntu

后端 未结 19 1758
遥遥无期
遥遥无期 2020-11-28 01:38

I was trying to set default python version to python3 in Ubuntu 16.04. By default it is python2 (2.7). I followed below steps :

19条回答
  •  余生分开走
    2020-11-28 01:43

    Just follow these steps to help change the default python to the newly upgrade python version. Worked well for me.

    • sudo apt-install python3.7 Install the latest version of python you want
    • cd /usr/bin Enter the root directory where python is installed
    • sudo unlink python or sudo unlink python3 . Unlink the current default python
    • sudo ln -sv /usr/bin/python3.7 python Link the new downloaded python version
    • python --version Check the new python version and you're good to go

提交回复
热议问题