Python 运行endpointscfg.py get_swagger_规范时出错

Python 运行endpointscfg.py get_swagger_规范时出错,python,google-app-engine,google-cloud-platform,google-cloud-endpoints,google-cloud-sdk,Python,Google App Engine,Google Cloud Platform,Google Cloud Endpoints,Google Cloud Sdk,我正在尝试使用Google云端点构建一个项目,遵循以下指南: 我被困在生成OpenAPI配置文件的步骤中,需要在其中运行以下命令: 尝试一次 $ lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com 我得到这个错误: -bash: lib/endpoints/endpointscfg.py: Permission denied sudo: lib/endp

我正在尝试使用Google云端点构建一个项目,遵循以下指南:

我被困在生成OpenAPI配置文件的步骤中,需要在其中运行以下命令:

尝试一次

$ lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com
我得到这个错误:

-bash: lib/endpoints/endpointscfg.py: Permission denied
sudo: lib/endpoints/endpointscfg.py: command not found
尝试两次

我用
sudo
尝试了相同的命令,该命令返回了以下错误:

-bash: lib/endpoints/endpointscfg.py: Permission denied
sudo: lib/endpoints/endpointscfg.py: command not found
尝试三次

$ lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com
我已尝试
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
$python lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi--主机名your-service.appspot.com
回溯(最近一次呼叫最后一次):
文件“lib/endpoints/endpointscfg.py”,第59行,在
导入_endpointscfg_设置35; pylint:disable=未使用的导入
文件“/Users/myName/lab/python docs samples/appengine/standard/endpoints-frameworks-v2/echo/lib/endpoints/_endpointscfg_setup.py”,第98行,在
_设置路径()
文件“/Users/myName/lab/python docs samples/appengine/standard/endpoints-frameworks-v2/echo/lib/endpoints/_endpointscfg_setup.py”,第94行,在_setuppath中
来自google.appengine.ext导入供应商
ImportError:没有名为appengine.ext的模块

与其直接运行它,不如尝试使用Python运行它,这是一种:

python lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com

试过了,对我很有效。我会尝试改进它(通过修复文档或在回购协议中应用一些修复),但这可能会在过渡期间满足您的需要。

与其直接运行它,不如尝试使用Python运行它,这是一种:

python lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com

试过了,对我很有效。我会努力改进(通过修复文档或在回购协议中应用一些修复),但这可能会在过渡期间满足您的需要。

我遇到了完全相同的问题,并尝试了相同的方法。对我起作用的是:

chmod +x lib/endpoints/endpointscfg.py

然后再次运行命令。

我遇到了完全相同的问题,并尝试了相同的方法。对我起作用的是:

chmod +x lib/endpoints/endpointscfg.py

然后再次运行该命令。

运行该命令似乎会带来不同的问题。我已更新我的问题以包含详细信息。您是否能够成功安装库?是。我已尝试删除
lib
并再次安装云端点库。然后我尝试运行
pythonlib/endpoints/endpointscfg.py…
。同样的错误。下面是确认我的云端点安装的消息。已成功安装cachetools dogpile.cache enum34-1.1.6 future-0.15.2 google apitools google endpoints google endpoints api management httplib2-0.9.2 oauth2client-3.0.0 ply-3.8 pyasn1-0.1.9 pyasn1-modules-0.0.8 pycrypto-pyjwkest-Pyrru请求rsa-3.4.2 setuptools-1.1.1.6 six-1.4.1.4.1 strict-rfc3339 lib3My抱歉。我忘了在回溯中包括最后一行:
ImportError:没有名为appengine.ext的模块
。在检查/google时,我找不到appengine模块。啊,好的。您是否安装了应用程序引擎Python SDK?运行此应用程序似乎会带来另一个问题。我已更新我的问题以包含详细信息。您是否能够成功安装库?是。我已尝试删除
lib
并再次安装云端点库。然后我尝试运行
pythonlib/endpoints/endpointscfg.py…
。同样的错误。下面是确认我的云端点安装的消息。已成功安装cachetools dogpile.cache enum34-1.1.6 future-0.15.2 google apitools google endpoints google endpoints api management httplib2-0.9.2 oauth2client-3.0.0 ply-3.8 pyasn1-0.1.9 pyasn1-modules-0.0.8 pycrypto-pyjwkest-Pyrru请求rsa-3.4.2 setuptools-1.1.1.6 six-1.4.1.4.1 strict-rfc3339 lib3My抱歉。我忘了在回溯中包括最后一行:
ImportError:没有名为appengine.ext的模块
。在检查/google时,我找不到appengine模块。啊,好的。您是否安装了应用程序引擎Python SDK?