ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

python-运行endpointscfg.py get_swagger_spec错误

2019-10-12 19:58:08  阅读:243  来源: 互联网

标签:google-cloud-sdk python google-app-engine google-cloud-platform google-cloud-end


我正在尝试按照以下指南使用Google Cloud Endpoints构建项目:Quickstart for Cloud Endpoints Frameworks on 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文件所在的文件夹中运行命令:

$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运行它:

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

尝试了一下,它只是为我工作.我会尝试使它变得更好(通过修复文档或在存储库中应用一些修复程序),但是在过渡期间可能会为您带来所需.

标签:google-cloud-sdk,python,google-app-engine,google-cloud-platform,google-cloud-end
来源: https://codeday.me/bug/20191012/1902800.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有