$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(pyenv init -)"' >> ~/.bashrc
$ pyenv -v
pyenv 1.2.18-12-g098227f2
pyenv install --list
pyenv install 3.6.1
$ pyenv install 3.8.2
Downloading openssl-1.1.0j.tar.gz...
-> https://www.openssl.org/source/old/1.1.0/openssl-1.1.0j.tar.gz
Installing openssl-1.1.0j...
.....
$ pyenv global 3.6.1
$ python --version
$ cd dir
$ pyenv local 3.6.1
$ python --version