pyenv 确实local也正在应用3.9,但
python --version, which python 都找不到,
最终在 .zshrc 文件下添加了PATH,完美解决问题。
原因就是【it needs to add its shims directory to the PATH 】
具体过程如下:
➜ ~ pyenv local 3.9
➜ ~ pyenv versions
system
3.8.15
* 3.9.4 (set by /Users/freddie/.python-version)
3.10.12
➜ ~ which python
python not found
➜ ~ which python3
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3
➜ ~ python --version
zsh: command not found: python
➜ ~ python3 --version
Python 3.11.3
GPT给出完美解答:
The pyenv changes seem to have taken effect correctly, since pyenv versions indicates Python 3.9.4 is now the local version. However, it seems like your shell isn’t recognizing the version switch and is still pointing to the system Python 3.11.3 for the python3 command. The python command doesn’t appear to be linked to any Python interpreter at all.
This could be because your PATH environment v