How to Resolve. Zshenv. Command Not Found Pyenv?

I have pyenv installed and my .zshenv looks like the following :

export PYENV_ROOT="$HOME"/.pyenv
export PATH="$PYENV_ROOT"/bin:"$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi
eval "$(pyenv virtualenv-init -)"

When I open a new terminal it gives me the following error:

.zshenv. command not found: : pyenv

1

1 Answer

The fix in the github issue link didn't work for me.

The problem was that pyenv wasn't on the path at the time of running pyenv init.

I add export PATH=/usr/local/bin:"$PATH" to my .zshenv before calling pyenv init.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest