我正在尝试使用Google构建一个项目,遵循以下指南:App上云端点框架的Quickstart。
在生成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文件相同的文件夹运行该命令:
$ 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发布于 2016-10-07 23:11:55
与其直接运行它,不如尝试使用Python运行它,一个la:
python lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com我试过了,但对我来说很管用。我将尝试使这一点变得更好(要么修复文档,要么在回购中应用一些修复),但这可能会让您在过渡期间得到所需的东西。
发布于 2016-10-18 15:52:36
我也有同样的问题,也尝试过同样的事情。对我有用的是:
chmod +x lib/endpoints/endpointscfg.py然后再运行命令。
https://stackoverflow.com/questions/39926853
复制相似问题