How do I set a default environment with pyenv-virtualenv?

12 views Asked by At

I want to auto activate when CDing so I have this in my zshrc:

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

But I also have a "default" virtual environment I want to load by default.

If I put a command like this in my zshrc I get Failed to activate virtualenv

# None of these commands work before or after the above commands
eval "$(pyenv activate '3.12.2/envs/main')"
pyenv activate '3.12.2/envs/main'
pyenv activate 'main'

After my shell starts though I can run the activate command and it works.

How do I set a default env and also keep the auto activation of the config file is in the folder behavior?

0

There are 0 answers