1. Download the Python source code from the official website and extract it to the specified directory.
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
xz -d Python-3.6.1.tar.xz
tar -xvf Python-3.6.1.tar
2. Switch to the Python source code directory and execute the following commands to configure and install.
cd Python-3.6.1
./configure --prefix=/usr/local/python3.6 --enable-optimizations
make && make install
3. If the installation fails, install the dependent libraries (because without these dependent libraries, the source code component installation may fail due to the lack of the underlying dependent libraries)