python - 警告:`pyenv init -` 不再设置 PATH。苹果系统
问题描述
由于错误的原因,我通过运行更新了我的 pyenv,pyenv 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.
与该问题没有直接关系,如果修复对您不起作用,发布 yout .zshrc .bashprofile 的片段可能有助于更好地理解问题
我希望这对你有用。
推荐阅读
- doxygen - 如何在 doxygen 配置文件(例如 iostream 库)中添加不带扩展名的文件?
- angular - Angular:HTTP调用完成之前的函数返回值
- mongodb - 使用游标聚合 Mongodb 集合
- vb.net - 为什么我不能在 VB.net 中进行比较?
- angular - 以角度复制图像
- c# - AddSingleton(S, T) 代替 AddSingleton(T) 的好处
- php - 如何重定向以从原始网址缩短网址?
- c - 赋值运算符在 C 程序中的 if 语句中作为条件工作正常
- python-3.x - 在 python 3.x 中执行 curl 命令是否有任何修改?
- python-3.x - 执行Nuitka编译的*.exe程序时如何隐藏cmd控制台?