LoginSignup
11
6

More than 1 year has passed since last update.

WARNING: `pyenv init -` no longer sets PATH. の対応

Posted at

ターミナルを開けると、ある日こんな警告が出ていました。

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

結論: https://github.com/pyenv/pyenv/blob/master/README.md に従って環境設定し直しましょう。

例えば Mac + ZSH + Homebrew の組み合わせの場合は以下の実行が必要です。

echo 'eval "$(pyenv init --path)"' >> ~/.zprofile

うっかり警告どおり pyenv init を実行してしまうとこんな表示が出るのですが:

# (The below instructions are intended for common
# shell setups. See the README for more guidance
# if they don't apply and/or don't work for you.)

# Add pyenv executable to PATH and
# enable shims by adding the following
# to ~/.profile and ~/.zprofile:

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

# Load pyenv into the shell by adding
# the following to ~/.zshrc:

eval "$(pyenv init -)"

# Make sure to restart your entire logon session
# for changes to profile files to take effect.

あれ、私の環境には ~/.profile も ~/.zprofile も無いのにどうしたら良いんだ!と混乱する羽目になってしまうので、余計な事考えずに README.md を読むべきだという結論です。

11
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
6