Pyenv pyenv lets you easily install and switch between multiple versions of Python.

Install and customization zsh

The main issues are described in wiki

curl https://pyenv.run | bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.zshrc
exec $SHELL
sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

Update pyenv

pyenv update

List of all versions available for installation

pyenv install -l

Install version of Python

pyenv install miniconda3-latest

List of installed versions

pyenv versions

Delete the installed version

pyenv uninstall miniconda3-latest

Install local version Python for project

cd pyprojects/testproject

pyenv local miniconda3-latest

pyenv version

or

pyenv versions

All commands

pyenv commands

Working in a virtual environment with a plugin pyenv-virtualenv

Create virtual environment

pyenv virtualenv miniconda3-latest venv

Switch to the venv

pyenv activate venv

Exit from the venv

pyenv deactivate

List of created virtual environments

pyenv virtualenvs

Delete the venv

pyenv virtualenv-delete venv