2017-07-01 71 views
1

根據official list of built-in librariesujson可用。但是,下面的app.yaml片段:如何在Google App Engine中使用ujson

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」條目。

任何線索爲什麼ujson不可用?

回答

1

ujson v1.35已添加到Python SDK版本1.9.55的應用引擎運行時。

此SDK版本不包含在gcloud SDK直到v 161.0.0 (2017-06-28)

Updated App Engine components for Python to version 1.9.55. Please visit the release notes for details


軼事:

我們中有些人還是喜歡appcfg.py update .代替gcloud app deploy app.yaml我們是一個稀有和垂死的品種:D)。

因此,在過去,我注意到我使用的appcfg.py工具是舊版應用程序引擎工具的舊版本。不會與所有的gcloud components update迷人。你每次都必須下載二進制文件。

which appcfg.py應揭露的確切一個正在使用這對我來說是:

$ ~/google_appengine/appcfg.py 

我不能說我沒有提醒不夠。此外,我總是看到這個建議/每次我跑gcloud components update時間警告:

WARNING: There are older versions of Google Cloud Platform tools on your system PATH. Please remove the following to avoid accidentally invoking these old tools:

/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 . 
+1

我以爲我會爲將來遇到類似問題的用戶留下_short_-ish解釋。可能不一定與這個問題有關,但嘿... –

+1

感謝您的所有細節!解決這個問題的關鍵是用於部署的工具的模糊性以及_both_ tools('gcloud'和'appcfg.py')與['gcloud' SDK](https://cloud.google。 COM/SDK /文檔/)。雖然「已過時」,但我在與gcloud SDK不同的位置更新了[_app引擎SDK_](https://cloud.google.com/appengine/docs/standard/python/download#appengine_sdk),因此未使用。 – hamx0r