Centos7.6安装Python3.7.2

一、 安装软件包的依赖

1. [root@VM-8-16-centos ~]# yum -y groupinstall "Development tools"   

2. [root@VM-8-16-centos ~]# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

3. [root@VM-8-16-centos ~]# yum install -y libffi-devel zlib1g-dev

4. [root@VM-8-16-centos ~]# yum install zlib* -y

二、 下载Python3.7.2软件包

1. [root@VM-8-16-centos ~]# wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz

2. [root@VM-8-16-centos ~]# tar xf Python-3.7.2.tar.xz

3. [root@VM-8-16-centos ~]# cd Python-3.7.2/

4.[root@VM-8-16-centos Python-3.7.2]# ./configure --prefix=/usr/local/python3 --enable-optimizations --with-ssl

5. [root@VM-8-16-centos Python-3.7.2]# make && make install    #编译时间有点长

6. [root@VM-8-16-centos Python-3.7.2]# ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3

7. [root@VM-8-16-centos Python-3.7.2]# ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3

8. [root@VM-8-16-centos Python-3.7.2]# python3 -V

9. [root@VM-8-16-centos Python-3.7.2]# pip3 -V

 

posted @ 2020-11-13 09:50  Shanghai-Roy  阅读(132)  评论(0编辑  收藏  举报