Search code examples
pythongoogle-app-enginesdkgoogle-cloud-sdk

Google App Engine dev_appserver throws error 'python2: command not found' after upgrade to Python 3


Until yesterday I was successfully using the dev_appserver.py app.yaml --enable_console for my development. Yesterday I attempted to upgrade to python 3.7 for my development. The upgrade seemed to be Ok, but now I get the following error message.

server:bones brian$ dev_appserver.py app.yaml --enable_console
ERROR: (dev_appserver) python2: command not found

app.yaml:

application: bones 
version: 1
runtime: python37
entrypoint: gunicorn -b :$PORT main:app
api_version: 1
threadsafe: true

handlers:
- url: /static
  static_dir: static

- url: /.*
  script: main.app

I am using Mac OS X 10.11.6.

Why is dev_appserver even looking for python2? And how can I fix this?


Solution

  • It doesnt look like you can fix that:

    Running dev_appserver requires the presence of Python 2.7.12+ on your local machine.

    https://cloud.google.com/appengine/docs/standard/python3/testing-and-deploying-your-app#local-dev-server