menu Chancel's blog
rss_feed
Chancel's blog
秋雨一何碧,山色倚晴空。

Pyenv无法初始化

安装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

参考资料:https://github.com/pyenv/pyenv/issues/1906

类型:Python
创建时间:2021 Jun 16
更新时间:2022 May 26

[[replyMessage== null?"发表评论":"发表评论 @ " + replyMessage.m_author]]

account_circle
email
web_asset
textsms

评论列表([[messageResponse.total]])

还没有可以显示的留言...
[[messageItem.m_author]] [[messageItem.m_author]]
[[messageItem.create_time]]
[[getEnviron(messageItem.m_environ)]]
[[subMessage.m_author]] [[subMessage.m_author]] @ [[subMessage.parent_message.m_author]] [[subMessage.parent_message.m_author]]
[[subMessage.create_time]]
[[getEnviron(messageItem.m_environ)]]