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.
- Add the lines below to your
~/.bash_profile
or~/.zprofile
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
- 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