apt-get install -y make build-essential libssl-dev zlib1g-dev
apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev llvm
# apt-get install -y libncurses5-dev libncursesw5-dev xz-utils tk-dev
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
./configure --enable-optimizations
make -j8
make altinstall
install with openssl
# source install openssl
# wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
./config shared --prefix=/usr/local/
make
make install
ldconfig
cd Python-3.x
./configure --enable-optimizations --with-openssl=/usr/local
make
make install