CentOS7下编译安装Python3.6.2

CentOS7下编译安装Python3.6.2

前期编译环境准备

yum -y groupinstall "Development tools"
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

准备安装文件

mkdir /usr/local/python3
准备好python3.6.2的安装包(用FTP传到服务器用户的默认文件夹下)

tar -xvJf  Python-3.6.2.tar.xz
cd Python-3.6.2

开始编译安装

./configure --prefix=/usr/local/python3
make && make install

最后创建Python与PIP软连接

ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
Tsumugi_Wenders

    发表评论