Sometimes our projects need to be run under Linux. Linux comes with python2, so the python3 environment must be reinstalled. Remember not to change the original python2 environment (Linux system depends on this environment).
python --version
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel
When the server download is slow, you can upload it to the server after the official website is downloaded locally.
https://www.python.org/ftp/python/3.7.2/
wget https://www.python.org/ftp/3.7.0/Python-3.7.2.tgz
cd opttar -zxvf Python-3.7.2.tgz
mkdir -p /usr/local/python3
cd Python-3.7.2/./configure --prefix=/usr/local/python3make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
python3 --versionpip -V
Recommended Posts