- Install pyenv by brew (MacOS)
- Set up your shell environment for Pyenv for pyenv (See detail)
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - zsh)"- Restart your shell or terminal and check it
pyenv local $your_python_version
source ~/.zshrc
pyenv versions
system
* $your_python_version
python --version- Set virtual environment by venv
python -m venv .venv
source .venv/bin/activate- Install packages by pip
pip install -r requirements.txt