Cannot switch Python with pyenv

后端 未结 6 906
忘掉有多难
忘掉有多难 2021-01-30 08:36

I would like to use pyenv to switch python2 and python3.

I successfully downloaded python2 and python3 and pyenv with following codes.

brew install pyenv         


        
6条回答
  •  终归单人心
    2021-01-30 09:22

    Try this: eval "$(pyenv init -)"

    Example:

    $ python -V
    Python 2.7.9
    mac:~ $ eval "$(pyenv init -)"
    mac:~ $ python -V
    Python 3.5.0
    

    More info: https://github.com/pyenv/pyenv

提交回复
热议问题