google dev_appserver throws error 'python2: command not found' after upgrade to python 3.7

♀尐吖头ヾ 提交于 2020-08-09 06:59:25

问题


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?


回答1:


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




回答2:


I've got a Python 3.7 Google App Engine project and am unable to execute the dev_appserver.py command for the same reason (python2: command not found). For various reasons, it isn't feasible to downgrade to Python 2.7.

I don't think the accepted answer here (that dev_appserver.py is only meant to work with Python 2.7) is accurate; the GAE documentation for Python 3.7 in fact lists dev_appserver.py as an option for local development. This seems more like a gcloud bug.

(Note: I know this would be better as a comment on the previous answer, but because I'm a new-ish SO user, I don't yet have permission to post comments)



来源:https://stackoverflow.com/questions/61503849/google-dev-appserver-throws-error-python2-command-not-found-after-upgrade-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!