Failed to activate virtualenv with pyenv Failed to activate virtualenv with pyenv python python

Failed to activate virtualenv with pyenv


That

eval "$(pyenv init -)"eval "$(pyenv virtualenv-init -)"

should be in .bashrc, not .bash_profile. The latter is executed only by login shells, the former by all interactive shells.


  1. Add the lines below to your ~/.bash_profile or ~/.zprofile
eval "$(pyenv init -)"  eval "$(pyenv virtualenv-init -)"
  1. Restart shell or run the command:
source ~/.bash_profile

Note:

If you are using zsh shell (default for macOS Catalina and/or Big Sur) you have to use ~/.zprofile file rather than ~/.bash_profile