The install instructions' optional step 2 involves adding the eval "$(pyenv virtualenv-init -)" line to ~/.bash_profile. The step being optional implies that I could also choose to activate virtualenvs _manually_ like this.
However, if I try it manually with the listed command, I get an error.
$ pyenv activate nameOfMyEnv
Failed to activate virtualenv.
Perhaps pyenv-virtualenv has not been loaded into your shell properly.
Please restart current shell and try again.
I guess the step is not optional after all?
It's still optional. I suspect your shell isn't configured to run pyenv-init. Please review your shell configuration.
Ah, I see. I still need eval "$(pyenv init -)"鈥攊t's only eval "$(pyenv virtualenv-init -)" that's optional.
Sorry about the confusion.
Most helpful comment
Ah, I see. I still need
eval "$(pyenv init -)"鈥攊t's onlyeval "$(pyenv virtualenv-init -)"that's optional.Sorry about the confusion.