pyenv / pyenv-virtualenv

a pyenv plugin to manage virtualenv (a.k.a. python-virtualenv)
MIT License
6.24k stars 399 forks source link

$PATH issues with zsh #315

Open strujilloc opened 5 years ago

strujilloc commented 5 years ago

I used to work with bash and installed bash without problem, but recently i change to zsh and i realize that i was using the system python version not from the shim.

I copy this to my .zshenv file

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

but the $PATH will change like this

echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/stc/.pyenv/bin

to solve this problem I copy my the config to the .zshrc instead and the shim path will become first. Any ideas why is it happen? I am using oh-my-zsh as a manager for my zsh

blueyed commented 5 years ago

Put a set -x / set +x before / after it, and see if it gets executed really.

btw: this is pyenv-virtualenv's repo, not pyenv.