ishandutta2007@MacBook-Pro:~$ python --version
Python 2.7.15
ishandutta2007@MacBook-Pro:~$ pyenv versions
system 2.7 * 3.7.0 (set by /Users/ishandutta2007/.pyenv/version)
ishandutta2007@MacBook-Pro:~$ pyenv global 3.7.0
ishandutta2007@MacBook-Pro:~$ pyenv versions
system 2.7 * 3.7.0 (set by /Users/ishandutta2007/.pyenv/version)
ishandutta2007@MacBook-Pro:~$ python --version
Python 2.7.15
ishandutta2007@MacBook-Pro:~$ python
Python 2.7.15 (default, Jun 17 2018, 12:46:58) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information.
答案 0 :(得分:1)
您需要添加:
eval "$(pyenv init -)"
.bash_profile或.bashrc
答案 1 :(得分:0)
问题是我需要将其添加到我的bash_profile
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi