Skip to content

Instantly share code, notes, and snippets.

@ajtran303
Last active October 29, 2020 20:41
Show Gist options
  • Save ajtran303/560c954c3440c63a3b58fd125a528ca5 to your computer and use it in GitHub Desktop.
Save ajtran303/560c954c3440c63a3b58fd125a528ca5 to your computer and use it in GitHub Desktop.
how to install pyenv and start the server

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment