According to the official list of built-in libraries, ujson
is available. However, the following app.yaml snippet:
libraries:
- name: ujson
version: '1.35'
...generates this error:
Usage: appcfg.py [options] update <directory> | [file, ...]
appcfg.py: error: Error parsing ./app.yaml: the library "ujson" is not supported
in "./app.yaml", line 89, column 1.
If I try to use other supported C libraries like numpy, it works fine. I am running SDK 159.0.0 (latest) and can even see a "ujson" entry in google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/api/appinfo.py
.
Any clue why ujson isn't usable?
ujson v1.35
was added to the app engine runtime in Python SDK version 1.9.55.This sdk version wasn't included in the gcloud sdk until v161.0.0 (2017-06-28):
Anecdote:
Some of us still prefer
appcfg.py update .
instead ofgcloud app deploy app.yaml
.(We are a rare and dying breed :D).So in the past I noticed that the
appcfg.py
tool I was using was an older version from the older app engine tooling. Doesn't come with all thegcloud components update
awesomeness. You had to download the binaries each time.which appcfg.py
should reveal the exact one being used which for me was:I can't say I wasn't warned enough. Besides, I kept seeing this advice/warning each time I ran
gcloud components update
:So update to the latest version, update your paths to point to the right appcfg, and enjoy
ujson
or any of the goodies as and when they drop.