当我在项目文件夹中运行 gcloud app deploy
时,出现以下错误:
ERROR: Service [None] uses unsupported Python 2.5 runtime. Please use [runtime: python27] instead.
ERROR: (gcloud.app.deploy) Errors occurred while parsing the App Engine app configuration.
但我非常怀疑我是否有任何 2.5 版本相关的东西。这是相当旧的版本。
我的 app.yaml 说:
runtime: python
entrypoint: gunicorn -b :$PORT main:app
runtime_config:
python_version: 3
handlers:
- url: .*
script: main.app
根据https://cloudplatform.googleblog.com/2016/08/python-3-on-Google-App-Engine-flexible-environment-now-in-beta.html Python 3 应该可用。或者现在还没有?
最佳答案
缺少的部分是env: flex
因此,正确的 yaml 文件应如下所示:
runtime: python
threadsafe: yes
env: flex
entrypoint: gunicorn -b :$PORT main:app
runtime_config:
python_version: 3
handlers:
- url: .*
script: main.app
关于python-3.x - Gcloud 应用程序部署出现不受支持的 Python 2.5 运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43820293/