sudo apt update sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
curl -O https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
tar -zxvf Python-3.8.0.tgz
cd Python-3.8.0
./configure --prefix=/usr/local/python3
make && make install
Four 、 Set up soft connections
ln -sf /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -sf /usr/local/python3/bin/pip3.8 /usr/bin/pip3
The final validation
Possible problems :
If pip3 abnormal , Please uninstall python2, Then recompile python3.8