Search code examples
pyenvpyenv-virtualenv

"command not found: pyenv" when opening terminal


Some time ago I installed and used pyenv for a purpose I don't need anymore. Then, I uninstalled it. However, whenever I open up my terminal the first thing it prints is:

/Users/jcortizrh/.zshrc:1: command not found: pyenv

So it looks like my terminal is still trying to use pyenv. How can I fix this? I tried editing the .zshrc file but it looks complicated and I'm afraid of modifying it and ruining my terminal somehow.

EDIT: my .zshrc looks like this:

PATH=$(pyenv root)/shims:$PATH

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/jcortizrh/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/jcortizrh/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/jcortizrh/opt/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/jcortizrh/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<


Solution

  • Turns out that removing the first line from my .zshrc solves the issue. Thanks for the suggestions!