News

New paper!

Wednesday, December 13, 2017

How to switch python versions on bash

$ pyenv global 2.7.13
or
$ pyenv global 3.6.0

(Depending on the version I need)
$ pyenv local x.x.x is to set the directory-specific python version. To unset it and use the globally set version instead,
$ pyenv local --unset

Required setup:

  • $ brew install pyenv
  • $ pyenv install 2.7.13
  • $ pyenv install 3.6.0
  • Add the following line to the top of .bash_profile
    eval "$(pyenv init -)"