1

根据内置库的官方列表ujson是可用的。但是,以下 app.yaml 片段:

libraries:
- name: ujson
  version: '1.35'

...产生此错误:

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.

如果我尝试使用其他受支持的 C 库,例如 numpy,它可以正常工作。我正在运行 SDK 159.0.0(最新),甚至可以在google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/api/appinfo.py.

任何线索为什么 ujson 不可用?

4

1 回答 1

1

ujson v1.35在 Python SDK 版本1.9.55中添加到应用引擎运行时。

在 v 161.0.0 (2017-06-28)之前,此 sdk 版本未包含在 gcloud sdk 中:

将 Python 的 App Engine 组件更新至版本 1.9.55。有关详细信息,请访问发行说明


轶事:

我们中的一些人仍然喜欢appcfg.py update .而不是gcloud app deploy app.yaml。(我们是一个稀有且垂死的品种:D)。

所以过去我注意到appcfg.py我使用的工具是旧应用引擎工具的旧版本。并没有带来所有的gcloud components update精彩。您每次都必须下载二进制文件。

which appcfg.py应该显示正在使用的确切一个对我来说是:

$ ~/google_appengine/appcfg.py

我不能说我没有得到足够的警告。此外,我每次跑步时都会看到这个建议/警告gcloud components update

警告:您的系统 PATH 上有旧版本的 Google Cloud Platform 工具。请删除以下内容以避免意外调用这些旧工具:

/Users/jeff/google_appengine/endpointscfg.py
/usr/local/bin/endpointscfg.py
/Users/jeff/google_appengine/dev_appserver.py

因此,更新到最新版本,更新您的路径以指向正确的 appcfg,并ujson在它们掉落时享受或任何好东西。

$ ~/google-cloud-sdk/platform/google_appengine/appcfg.py update .
于 2017-07-01T21:36:09.980 回答