Linux Is installed by default on the server python2.7, Follow the steps below to upgrade to python3
Python3.7 Version above , You need to install one more dependency package :
> yum install -y libffi-devel
Otherwise ModuleNotFoundError: No module named _ctypes The error of .
# download > wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
# decompression > tar -zxf Python-3.7.3.tgz
# Install dependency packages > yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc libffi-devel
# Get into python3 Unzip directory > cd Python-3.7.3
# compile > ./configure --prefix=/usr/local/python3.7
# install > make && make install
The system may depend on some software Python2 function , So you can't delete Python2, Need for the original python Soft connection pointing python3
>mv /usr/bin/python /usr/bin/python.bak
Create a new soft connection
> ln -s /usr/local/python3.7/bin/python3 /usr/bin