Install the pyenv version manager
$ brew install pyenv
$ pyenv install 3.8.6
$ pyenv global 3.8.6
Add this to your ~/.zshrc
so your terminal will use pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
Restart your terminal and go to the project.
Create and activate your virtual environment
python -m venv ./venv
source venv/bin/activate
Install
pip install -r requirements.txt
Run the server
gunicorn app:app
Close the server ctrl+c
Deactivate venv
$ deactivate