1#install or update brew
2$ brew install pyenv
3#install
4$ pyenv install 3.7.3
5#make default
6$ pyenv global 3.7.3
7# and verify
8$ pyenv version
93.7.3 (set by /Users/mbbroberg/.pyenv/version)
10$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
11#reset the current shell
12$ exec $0
13$ which python
14#/Users/mbbroberg/.pyenv/shims/python
15$ python -V
16$ pip -V
17#pip 19.0.3 from /Users/mbbroberg/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip (python 3.7)
1# it is said not to do but I used it anyway, because of the conveniency
2$ echo "alias python=/usr/local/bin/python3.7" >> ~/.zshrc