为什么python控制台没有选择pyenv全局版本?

为什么python控制台没有选择pyenv全局版本?,python,pyenv,Python,Pyenv,问题是我需要将此添加到我的bash_配置文件中 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 inform

问题是我需要将此添加到我的
bash_配置文件中

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.

在.bash_配置文件或.bashrc

中,您能否在
pyenv global
之前和之后运行并发布
pyenv version
的输出?根据您的请求更新
python3--version
将起作用。Python(2.x版)和Python 3(3.x版)是两种不同的软件。在.bash_配置文件或.bashrc中是否有eval“$(pyenv init-”,是否可以执行echo$pathThank@dilkash这是问题所在,您可以移动它来回答问题
 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.
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi
eval "$(pyenv init -)"