如何在Linux Mint中将python3更改为默认值 [英] How to change python3 to default in linux mint

查看:39
本文介绍了如何在Linux Mint中将python3更改为默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新安装的操作系统linux Mint 19.3中将python3更改为默认值时,我遇到了一些问题.在Ubuntu 16.04上这非常容易,但是现在我需要一点帮助.

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.

所以,我运行

python --version

得到了

Python 2.7.15+

比我奔跑

python3 --version

这就是结果

Python 3.6.8

输入此命令后

sudo update-alternatives --config python

我收到明显的信息

update-alternatives: error: no alternatives for python

两个版本的python都位于/usr/bin文件夹中.当我尝试通过键入命令将python3更改为默认值时发生此问题

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

终端输出以下内容

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

这篇关于如何在Linux Mint中将python3更改为默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆