CentOS7 yum安裝python3.6

CentOS7 yum安裝python3.6node

環境

[root@node1 ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core)

依賴epel源python

配epel源_阿里

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

安裝python3.6.8

yum install python36 -y

依賴:python36-libspython2.7

安裝pip3

# 搜索pip3的安裝包名稱
yum  whatprovides pip3

# 安裝pip3
yum install python36-pip -y

依賴:python36-setuptoolside

驗證

[root@node1 ~]# python3 --version
Python 3.6.8

查看指向

[root@node1 ~]# ll /usr/bin/python
lrwxrwxrwx. 1 root root 7 5月  13 23:21 /usr/bin/python -> python2
[root@node1 ~]# 
[root@node1 ~]# ll /usr/bin/python2*
lrwxrwxrwx. 1 root root    9 5月  13 23:21 /usr/bin/python2 -> python2.7
-rwxr-xr-x. 1 root root 7216 10月 31 2018 /usr/bin/python2.7
[root@node1 ~]# 
[root@node1 ~]# ll /usr/bin/python3*
lrwxrwxrwx 1 root root     9 5月  20 17:48 /usr/bin/python3 -> python3.6
lrwxrwxrwx 1 root root    18 5月  20 17:48 /usr/bin/python36 -> /usr/bin/python3.6
-rwxr-xr-x 2 root root 11408 4月  26 05:05 /usr/bin/python3.6
-rwxr-xr-x 2 root root 11408 4月  26 05:05 /usr/bin/python3.6m
[root@node1 ~]#

由上可知
python 表明CentOS7系統默認的 python2.7
python3 表明新安裝的 python3.6工具

安裝python開發工具開發工具

yum install python36-devel -y
相關文章
相關標籤/搜索