系统相关
首页 > 系统相关> > centos 用yum安装python3

centos 用yum安装python3

作者:互联网

如何在centos7下用yum安装python3

1 下载epel

sudo yum install epel-release

2.安装python3

sudo yum install python34

3.更改默认python

whereis python
python: /usr/bin/python2.7 /usr/bin/python /usr/bin/python3.4 /usr/bin/python3.4m /usr/lib/python2.7 /usr/lib/python3.4 /usr/lib64/python2.7 /usr/lib64/python3.4 /etc/python /usr/include/python2.7 /usr/include/python3.4m /usr/share/man/man1/python.1.gz

cd /usr/bin/
rm /usr/bin/python
ln -s /usr/bin/python3.4 usr/python/python

4.测试

python -v

Python 3.4.10 (default, Apr  8 2019, 02:17:36) 

 

标签:bin,centos,python,python2.7,python3.4,yum,usr,python3
来源: https://www.cnblogs.com/playon/p/10998018.html