Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine - Error (libraries entries are only supported by the "python27" runtime)

I developed a web application based on Python 3.6 and Django 2.0 and want to deploy in Google App Engine for the first time. When I tried to deploy (gcloud app deploy) it, it did not go through and showed me the error message as follows:

(acct) C:\Users\tsjee_000\dev\acct\src>gcloud app deploy
ERROR: (gcloud.app.deploy) An error occurred while parsing file: [C:\Users\tsjee_000\dev\acct\src\app.yaml]
libraries entries are only supported by the "python27" runtime
  in "C:\Users\tsjee_000\dev\acct\src\app.yaml", line 34, column 13

app.yaml:

runtime: python
api_version: 1
threadsafe: yes
env: flex
entrypoint: gunicorn -b :$PORT main:app

handlers:
- url: /static
  static_dir: static/
- url: .*
  script: acct.wsgi.application

libraries:
- name: MySQLdb
  version: 1.2.5

Does not GAE support Python 3 and Django 2 yet? I looked for the answer and tried in many ways but it did not work.

like image 600
TS Jee Avatar asked Sep 19 '25 11:09

TS Jee


1 Answers

You're mixing up standard environment app.yaml config elements (libraries in your case) into a flexible environment app.yaml configuration file, which causes the error you see.

Notes:

  • the standard environment only supports python 2.7, which is where the version mentioned in the error message comes from
  • depending on which such element is introduced there may be no error generated, things may be silently not working - your handlers configs, for example, also standard environment specific

In the flexible environment your dependencies are managed:

  • via your app's requirements.txt file, for python dependencies, see Using Python Libraries
  • by including them in a custom runtime, for non-python dependencies, see Building Custom Runtimes

Maybe of interest: How to tell if a Google App Engine documentation page applies to the standard or the flexible environment

like image 185
Dan Cornilescu Avatar answered Sep 22 '25 08:09

Dan Cornilescu