Setup Python 3.7 for Google App Engine Standard

August 30, 2018

Create a google cloud project with app engine.

You shall be promoted to selected a Region (and this CANNOT be changed after selection).

NOTE: A reference for latency across region using GCP.

NOTE: If you intend to use some Beta products, I would recommend us-central.

Create a virtualenv for your project.

virtualenv -p python3 env
source env/bin/activate

NOTE: Though the official documentation use virtualenv env, but you might end up with python2 depending what is your default python version. Check python version python --version.

NOTE: I opt for using pyenv with virtualenv instead.

Make a directory for your project.

mkdir <PROJECT>

Edit requirements.txt to specify all the dependencies.


Install the dependencies (for local development).

pip install  -r requirements.txt


from flask import Flask

app = Flask(__name__)

def hello():
  return "Hello"

if __name__ == '__main__':'', port=8088, debug=True)  

Run the application.


NOTE: dev_appserver is no longer the prefered way for local development.

Access the web page at

Edit app.yaml.

runtime: python37


gcloud app deploy --project <PROJECT> -v 1

You might be interested of the following:


This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.