我遇到以下与pyenv矛盾的问题:
$ pyenv global python2.7.10
pyenv: version `python2.7.10' not installed
$ pyenv install 2.7.10
pyenv: /Users/xeli/.pyenv/versions/2.7.10 already exists
continue with installation? (y/N)
还:
$ python2.7
pyenv: python2.7: command not found
The `python2.7' command exists in these Python versions:
2.7.10
垫片根据需要位于 PATH 上:
$ echo $PATH
/Users/xeli/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
垫片目录中没有任何可疑之处:
$ ls ~/.pyenv/shims | grep python2
ipython2
python2
python2-config
python2.6
python2.6-config
python2.7
python2.7-config
在我的.profile
我有:
export PYENV_ROOT=~/.pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
因此 pyenv 应该在启动时初始化。
我无法弄清楚如何解决这个问题。有任何想法吗?