Install Python 3.7 via pyenv
pyenv install 3.7.4
TLDR
sudo apt-get updatesudo apt-get install build-essential zlib1g-dev libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev
Optional
sudo apt-get install tk-dev
Common Errors
configure: error: no acceptable C compiler found in $PATH
sudo apt-get updatesudo apt-get install build-essential
zipimport.ZipImportError: can't decompress data; zlib not available
sudo apt-get install zlib1g-dev
ModuleNotFoundError: No module named '_ctypes'
sudo apt-get install libffi-dev
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
sudo apt install libssl-dev
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
sudo apt install libbz2-dev
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
sudo apt install libreadline-dev
WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?
sudo apt install libsqlite3-dev
UserWarning: Could not import the lzma module. Your installed Python is incomplete
sudo apt-get install liblzma-dev
References: