centos7下部署python

1.在liunx上安装python运行环境

[root@localhost ~]# yum -y install gcc

centos7下部署python_第1张图片

 [root@localhost ~]# 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 libffi-devel

2.进入到安装目录

[root@localhost ~]# cd /opt

3.下载python3.7的安装包 (可能会有点慢)

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

centos7下部署python_第2张图片

4.解压安装包

[root@localhost opt]# tar -zxvf Python-3.7.0.tgz

5.配置python环境以及安装编译python

[root@localhost opt]# mkdir /opt/python3

[root@localhost opt]# cd Python-3.7.0

[root@localhost Python-3.7.0]# ./configure --prefix=/opt/python3
 [root@localhost Python-3.7.0]# make && make install

6.确认安装成功

[root@localhost Python-3.7.0]# /opt/python3/bin/python3.7

会出现:

centos7下部署python_第3张图片

表示安装成功~
————————————————

你可能感兴趣的:(python,linux,centos,运维,服务器)