sudo apt install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl
curl https://pyenv.run | bash
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Puis
source ~/.bashrc # ou ~/.zshrc
pyenv install -v 3.10.4
pyenv uninstall -v 3.10.4
pyenv versions
python --version
Python 3.10.12
pyenv local 3.10.4
python --version
Python 3.10.4
Format : pyenv virtualenv
pyenv virtualenv 3.10.4 test1
pyenv versions
pyenv activate <name>
source chemin/to/.pyenv/versions/<name>/bin/activate
pyenv deactivate
source deactivate
pyenv virtualenv-delete <name>