Pyenv-virtualenv: Manual activation fails

Created on 2 Mar 2016  路  2Comments  路  Source: pyenv/pyenv-virtualenv

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?

Most helpful comment

Ah, I see. I still need eval "$(pyenv init -)"鈥攊t's only eval "$(pyenv virtualenv-init -)" that's optional.

Sorry about the confusion.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings