I have been running pyenv from homebrew on Mac so I could run Python3 rather than 2.7. However when I upgraded to Catalina I ran into an issue that pyenv wasn’t working anymore. When I went through the GitHub page for pyenv at: pyenv and followed all of the steps and got to this part:
- Add
pyenv init
to your shell to enable shims and autocompletion. Please make sureeval "$(pyenv init -)"
is placed toward the end of the shell configuration file since it manipulatesPATH
during the initialization.$ echo -e ‘if command -v pyenv 1>/dev/null 2>&1; then\n eval “$(pyenv init -)”\nfi’ >> ~/.bash_profile- Zsh note: Modify your
~/.zshenv
file instead of~/.bash_profile
. - fish note: Use
pyenv init - | source
instead ofeval (pyenv init -)
. - Ubuntu and Fedora note: Modify your
~/.bashrc
file instead of~/.bash_profile
.General warning: There are some systems where theBASH_ENV
variable is configured to point to.bashrc
. On such systems you should almost certainly put the abovementioned lineeval "$(pyenv init -)"
into.bash_profile
, and not into.bashrc
. Otherwise you may observe strange behaviour, such aspyenv
getting into an infinite loop. See #264 for details.
- Zsh note: Modify your
.zshenv should actually be .zshrc