Build Python From Source

apt install -y libsqlite3-dev libreadline-dev libffi-dev libz-dev libssl-dev

curl -LO "https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz"

tar -xvf Python-3.8.2.tgz
cd ./Python-3.8.2

./configure \
    --prefix ~/.bin/python3.8.2 \
    --enable-optimizations \
    --enable-loadable-sqlite-extensions

make -j$(nproc)
make install

ln -s python3.8.2/bin/python3 ~/.bin/python3
ln -s python3.8.2/bin/python3.8 ~/.bin/python3.8
ln -s python3.8.2/bin/python3.8-config ~/.bin/python3.8-config