看是zsh还是bash
echo $SHELL
zsh
配置到~/.zshrc 文件
vim ~/.zshrc
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
执行
source ~/.zshrc
bash
vim ~/.bashrc
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
source ~/.bashrc
参考: