Installation of pyenv and pyenv-virtualenv

% brew install pyenv pyenv-virtualenv pyenv-which-ext

Append lines to .zprofile and .zshrc

% echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
% cat << EOF >> ~/.zshrc
eval "$(pyenv init -)"
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
EOF

Install required python versions & create virtual environment based on that

% pyenv install 3.10.0
% pyenv virtualenv 3.10.0 venv3100

Set venv for your project directory

% cd ~/temp/test3
% pyenv local venv3100

Project directory setup with project specific virutalenv (specific python version and pip packages)

% cd ~/tools/theharvester
% pyenv virtualenv 3.10.0 venv3100_theharvester
% pyenv local venv3100_theharvester