I know that to activate a virtual environment with pyenv, we can run pyenv activate [virtualenv], but here, i also saw that we can "select" a virtual environment by running pyenv local [virtualenv].
So what is the difference between the two ways?
The base command is
pyenv local <python_version>. It selects what Python version to use in the current directory or its subdirectories.pyenv activate <name>activates a Python virtual environment.pyenv local <venv-name>works afterpyenv virtualenv venv-nameandeval "$(pyenv virtualenv-init -)"in shell configuration. After the command the<venv-name>(a virtual environment known topyenv) is activated when entering (withcd) the directory wherepyenv local <venv-name>had been run.