编译安装Python3

编译安装Python3


#!/bin/bash

yum install -y wget gcc make zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel

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

tar zxvf Python-3.5.1.tgz
cd Python-3.5.1
./configure --prefix=/usr/local/python3
make && make install

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

pip3 install --upgrade pip