作者:E4b9a6, 创建:2021-06-16, 字数:639, 已阅:90, 最后更新:2024-03-10
安装Pyenv后,按照提示添加下面3个环境初始化的命令到 ~/.zshrc 中,结果提示警告信息 ** pyenv init -
no longer sets PATH.**
~ ➤ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
~ ➤ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
~ ➤ echo 'eval "$(pyenv init -)"' >> ~/.zshrc
~ ➤ source ~/.zshrc
WARNING: `pyenv init -` no longer sets PATH.
Run `pyenv init` to see the necessary changes to make to your configuration.
~ ➤
修改原3个环境变量形式如下即可解决
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init --path)"
fi