安装 - python
2021-03-15
#!/bin/bash
yum install -y git openssl-devel python-devel gcc gcc-c++ libtool make mysql-devel MYSQL-python libffi-devel
cd /usr/local/src
export PYTHON_TGZ_VERSION=3.8.3
export PYTHON_VERSION=3.8
wget https://www.python.org/ftp/python/${PYTHON_TGZ_VERSION}/Python-${PYTHON_TGZ_VERSION}.tgz
tar -xzvf Python-${PYTHON_TGZ_VERSION}.tgz
cd Python-${PYTHON_TGZ_VERSION}
./configure --prefix=/usr/local/python-${PYTHON_VERSION} --enable-shared
make && make install
ln -sf /usr/local/python-${PYTHON_VERSION}/lib/libpython${PYTHON_VERSION}.so.1.0 /usr/lib64/
ln -sf /usr/local/python-${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/configparser.py /usr/local/python-${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/ConfigParser.py
ln -sf /usr/local/python-${PYTHON_VERSION}/bin/pip3 /usr/local/bin/
ln -sf /usr/local/python-${PYTHON_VERSION}/bin/python3 /usr/local/bin/
/usr/local/bin/pip3 install --upgrade pip
/usr/local/bin/pip3 install gunicorn
ln -sf /usr/local/python-${PYTHON_VERSION}/bin/gunicorn /usr/local/bin/