Home  >  Q&A  >  body text

mac系统下,Python版本切换问题?

请问各位,电脑里装了两个版本的python,2.7.10和3.5.1,想用pyenv在两个版本中切换。截图如下

明明已经切换到3.5.1了,但用的时候还是2.7.10,怎么解决?谢谢!
试了用global,还是不行。。。

迷茫迷茫2765 days ago996

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 17:53:59

    Already solved, you need to add
    `export PYENV_ROOT=/usr/local/var/pyenv under the .bash_profile file after installing pyenv
    if which pyenv > /dev/null; then eval "$(pyenv init -) "; fi`
    After these two lines, source it. Then install 2.7.10 and 3.5.1, and then you can switch normally

    reply
    0
  • PHPz

    PHPz2017-04-17 17:53:59

    tryglobal

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:53:59

    pyenv global 3.5.1

    reply
    0
  • Cancelreply