menu Chancel's blog
rss_feed
Chancel's blog
有善始者实繁,能克终者盖寡。

Pyenv无法初始化

作者:Chancel Yang, 创建:2021-06-16, 字数:638, 已阅:66, 最后更新:2024-03-10

这篇文章更新于 124 天前,文中部分信息可能失效,请自行甄别无效内容。

安装Pyenv后,按照提示添加下面3个环境初始化的命令到 ~/.zshrc 中,结果提示警告信息 ** pyenv init - no longer sets PATH.**

Bash
~ ➤ 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个环境变量形式如下即可解决

Bash
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


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

account_circle
email
web_asset
textsms

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

还没有可以显示的留言...
gravatar
[[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)]]