我正在尝试按照本指南使用 Google Cloud Endpoints 构建一个项目:App Engine 上的云端点框架快速入门.
我陷入了生成 OpenAPI 配置文件的步骤,需要运行以下命令:
尝试一
$ lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com
我收到此错误:
-bash: lib/endpoints/endpointscfg.py: Permission denied
尝试二
我尝试过相同的命令sudo
,返回此错误:
sudo: lib/endpoints/endpointscfg.py: command not found
尝试三
我已经尝试过cd lib/endpoints
从同一文件夹运行命令endpointscfg.py
file:
$ cd lib/endpoints
$ endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com
usage: /Users/myName/google-cloud-sdk/platform/google_appengine/endpointscfg.py
[-h] {get_client_lib, get_discovery_doc} ...
/Users/myName/google-cloud-sdk/platform/google_appengine/endpointscfg.py: error: argument {get_client_lib, get_discovery_doc}: invalid choice: 'get_swagger_spec' (choose from 'get_client_lib', 'get_discovery_doc')
尝试四
使用 python 运行它会返回不同类型的问题:
$ python lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com
Traceback (most recent call last):
File "lib/endpoints/endpointscfg.py", line 59, in <module>
import _endpointscfg_setup # pylint: disable=unused-import
File "/Users/myName/lab/python-docs-samples/appengine/standard/endpoints-frameworks-v2/echo/lib/endpoints/_endpointscfg_setup.py", line 98, in <module>
_SetupPaths()
File "/Users/myName/lab/python-docs-samples/appengine/standard/endpoints-frameworks-v2/echo/lib/endpoints/_endpointscfg_setup.py", line 94, in _SetupPaths
from google.appengine.ext import vendor
ImportError: No module named appengine.ext