download
wget https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tgz
decompression
tar -xf Python-3.9.5.tgz cd Python-3.9.5
Compile Install
./configure && make && make install
python3 -V
Establish soft connection
ln -s /usr/local/bin/python3.9 /usr/bin/python ln -s /usr/local/bin/python3.9-config /usr/bin/python-config
The pip command reports an error
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
pip -V
Uninstall Python 3
rpm -qa|grep python3|xargs rpm -ev --allmatches --nodeps
whereis python3 |xargs rm -frv
whereis python