How to change python3 to default in linux mint

牧云@^-^@ 提交于 2021-01-01 07:32:05

问题


I have a little problem with changing python3 to default in newly installed operating system linux Mint 19.3. It was pretty easy on Ubuntu 16.04 but now I need small help here.

So, I run

python --version

and got this

Python 2.7.15+

Than I run

python3 --version

and this was the result

Python 3.6.8

After entering this command

sudo update-alternatives --config python

I received obvious info

update-alternatives: error: no alternatives for python

Both version of python are located in /usr/bin folder. The issue occurs when I'm trying to change python3 to as a default by typing the command

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6

The terminal outputs the following

update-alternatives: --install needs <link> <name> <path> <priority>

Any help here would be welcome.


回答1:


In your case, priority is missing, just append 1 at the end of the command like this :

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1


来源:https://stackoverflow.com/questions/59916531/how-to-change-python3-to-default-in-linux-mint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!