Cannot switch Python with pyenv
Try this: eval "$(pyenv init -)"
Example:
$ python -VPython 2.7.9mac:~ $ eval "$(pyenv init -)"mac:~ $ python -VPython 3.5.0
More info:https://github.com/pyenv/pyenv
[July 2021]
If you see this message when running eval "$(pyenv init -)"
WARNING: `pyenv init -` no longer sets PATH.Run `pyenv init` to see the necessary changes to make to your configuration.
you should check the message from pyenv init
as the warning says, but in a nutshell, you can use eval "$(pyenv init --path)"
instead.
And don't forget to accordingly update your ~/.bash_profile
, ~/.zshrc
or the like if necessary.