警告:`pyenv init -` 不再设置路径。苹果系统

2024-01-09

由于错误的原因,我通过运行更新了我的 pyenvpyenv update,此后每次我打开新控制台时都会出现此错误

WARNING: `pyenv init -` no longer sets PATH.
Run `pyenv init` to see the necessary changes to make to your configuration.

我尝试将其添加到我的 .zshrc 中:

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

在其他帖子和问题中建议这样做,但在这种情况下,我收到了另一条错误消息:

Failed to initialize virtualenvwrapper.

Perhaps pyenv-virtualenvwrapper has not been loaded into your shell properly.
Please restart current shell and try again.

更多信息:

系统:MacOS Catalina 10.15.7 Pyenv 版本 2.0.2

多谢你们


看来您需要按照原始错误消息中的建议步骤进行操作

run `pyenv init` to see the necessary changes to make to your configuration.

我也收到了同样的信息,而我所要做的就是:

1-在 .zprofile 中(在我的情况下,我没有,我必须在用户根路径中创建它)我添加了以下内容:

Pyenv settings
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"

2-在.zshrc中我添加了:

eval "$(pyenv init -)"

仅此而已

顺便说一下你的错误:

Failed to initialize virtualenvwrapper.

Perhaps pyenv-virtualenvwrapper has not been loaded into your shell properly.
Please restart current shell and try again.

与该问题没有直接关系,如果修复对您不起作用,也许发布 .bashrc .bash_profile 的片段可以帮助您更好地理解问题

我希望这对你有用。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

警告:`pyenv init -` 不再设置路径。苹果系统 的相关文章

随机推荐