我是靠谱客的博主 伶俐樱桃,这篇文章主要介绍Linux同时安装python2和Python3,现在分享给大家,希望可以做个参考。

我们以Centos为例,默认地,Linux安装好后会默认安装python2版本:

[root@localhost spiders]# python –version
Python 2.7.5

[root@localhost spiders]# python
Python 2.7.5 (default, Oct 30 2018, 23:45:53)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>>

安装Python3:

[root@localhost spiders]# yum install python3

[root@localhost spiders]# python3
Python 3.6.8 (default, Apr 2 2020, 13:34:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>>

最后

以上就是伶俐樱桃最近收集整理的关于Linux同时安装python2和Python3的全部内容,更多相关Linux同时安装python2和Python3内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(54)

评论列表共有 0 条评论

立即
投稿
返回
顶部