I installed:
$ pyenv install 3.7.3
$ pyenv versions
system *
3.7.3
$
Then to switch from system (Python 3.8.5) to 3.7.3 I can use both global and shell:
$ pyenv global 3.7.3
$ python3 --version
3.7.3
$
$ pyenv global system
$ python3 --version
3.8.5
$
$ pyenv shell 3.7.3
$ python3 --version
3.7.3
$
$ pyenv shell system
$ python3 --version
3.8.5
$
What is the difference between the switch using global and the one using pyenv shell ?
Note: If we mix pyenv shell
and pyenv global
we get strange results
on my ~/.bashrc
:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
pyenv
commands are actually quite well explained in the documentation: github.com/pyenv/pyenv/blob/master/COMMANDS.md – Baseburner