Linux CentOS 7,如何将Python2.7设置为默认Python版本? [英] Linux CentOS 7, how to set Python2.7 as default Python version?

查看:522
本文介绍了Linux CentOS 7,如何将Python2.7设置为默认Python版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用运行Linux CentOS 7的笔记本电脑。
我安装了Python2.7,然后又安装了Anaconda,后者安装了Python3.5.2

I'm using a laptop running Linux CentOS 7. I installed Python2.7, and then I installed Anaconda, which installed Python3.5.2

我希望我的系统默认使用Python2.7,但是如果我从终端输入 python ,它将从Anaconda启动Python3.5.2:

I want my system to use Python2.7 as default, but if I type python from my terminal, it launches Python3.5.2 from Anaconda:

[davide@opennet-33-58 ~]$ python
Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

我试图删除Python3,但它仍然存在...

I tried to remove Python3 but it's still there...

如何将Python2.7设置为计算机上的默认Python版本?

谢谢

推荐答案

也许您想熟悉替代品

替代项创建,删除,维护和显示有关构成替代项系统的符号链接的信息。替代系统是Debian替代系统的重新实现。

alternatives creates, removes, maintains and displays information about the symbolic links comprising the alternatives system. The alternatives system is a reimplementation of the Debian alternatives system.

查看此内容线程,在这里我快速遍历基本命令以实现您所请求的功能,还可以查看 替代项联机帮助页

Check out this thread where i quickly go over the basic commands to achieve what you are requesting and also have a look at alternatives manpages

这篇关于Linux CentOS 7,如何将Python2.7设置为默认Python版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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