$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi' >> ~/.bash_profile
$ source ~/.bash_profile
$ pyenv install 3.9.5
$ pyenv install 2.7.18
$ pyenv virtualenv 3.9.5 myproject
$ pyenv activate myproject
$ python --version