It can be done easier:
after installation of appropriate python
pyver=3.7.4
wget https://www.python.org/ftp/python/${pyver}/Python-${pyver}.tgz
tar xzvf Python-{pyver}.tgz cd Python-{pyver}
./configure --prefix=$HOME/.local
make
make install
it needs to define PYTHONPATH as follows:
export PYTHONPATH=$HOME/.local/site-packages
install necessary packages, that is all
BR,
Evgeii