centos7安装python3(保留python2.7)
yum -y install zlib-devel bzip2-devel libffi-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make wget
install_path=/usr/local/python3
mkdir -p $install_path
cd /tmp
wget -c https://registry.npmmirror.com/-/binary/python/3.6.9/Python-3.6.9.tar.xz
tar -xvJf Python-3.6.9.tar.xz
cd Python-3.6.9
./configure prefix=$install_path
make && make install
ln -sf $install_path/bin/python3 /usr/bin/python3
ln -sf $install_path/bin/pip3 /usr/bin/pip3
mkdir -p ~/.pip
touch ~/.pip/pip.conf
echo "" > pip.conf
echo "[global]" >> pip.conf
echo "index-url = https://pypi.tuna.tsinghua.edu.cn/simple" >> pip.conf
echo "[install]" >> pip.conf
echo "trusted-host=pypi.tuna.tsinghua.edu.cn" >> pip.conf
echo "disable-pip-version-check = true" >> pip.conf
echo "timeout = 6000" >> pip.conf
python3 -V
pip3 -V