0

I set up Zsh (with OhMyZsh) within Windows Terminal app 8 months ago, and used it many times to develop Python apps.

A couple months ago, I started getting the following error message when opening the terminal:

# Load pyenv automatically by appending
# the following to your profile:

eval "$(pyenv init -)"

# Load pyenv automatically by appending
# the following to your profile:

eval "$(pyenv init -)"

Found pyenv, but it is badly configured (missing pyenv shims in $PATH). pyenv might not
work correctly for non-interactive shells (for example, when run from a script).

To fix this message, add these lines to the '.profile' and '.zprofile' files
in your home directory:

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

You'll need to restart your user session for the changes to take effect.
For more information go to https://github.com/pyenv/pyenv/#installation.

I have tried including the line eval "$(pyenv init -) in the end of my .profile file, and also included export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init --path) in the end of both the .profile and .zprofile files, as suggested by the error message.

However, the message keeps appearing. I haven't seen any implication yet - I can still open jupyter notebooks and work on them, still, I wanted to solve this.

Any ideas?

Thanks!

  • Can you confirm in which OS you've got `zsh`/`ohmyzsh` configured and in which you're having this issue? Windows Terminal supports several applications, including PowerShell and cmd.exe native to Windows but also any Linux installed with WSL. My gut tells me this is in a WSL environment, but clarifying that would help. – Daniel Black Sep 23 '21 at 20:29
  • Your gut is right, it is an WSL environment (Ubuntu). – Bruno Prates Sep 25 '21 at 20:56

2 Answers2

0

This is because pyenv doesn't directly support Windows so this message will keep appearing, to solve this problem i recommend you to install a pyenv ported version on your windows, i recommend you this one, just check the installation and the usage

pyenv for windows

I hope I've helped ;)

DavidsDvm
  • 54
  • 3
0

Turns out it appears to be a bug with ohmyzsh. Some folks have successfully updated ohmyzsh and the error no longer pops up, but I used the tactic mentioned in this comment to just avoid the error message by brute force, setting ZSH_PYENV_QUIET to true. Since I know pyenv is configured correctly in my case, I'm fine with it.

Daniel Black
  • 968
  • 1
  • 7
  • 11