python-运行endpointscfg.py get_swagger_spec错误
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了python-运行endpointscfg.py get_swagger_spec错误,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1941字,纯文字阅读大概需要3分钟。
内容图文
我正在尝试按照以下指南使用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
尝试了一下,它只是为我工作.我会尝试使它变得更好(通过修复文档或在存储库中应用一些修复程序),但是在过渡期间可能会为您带来所需.
内容总结
以上是互联网集市为您收集整理的python-运行endpointscfg.py get_swagger_spec错误全部内容,希望文章能够帮你解决python-运行endpointscfg.py get_swagger_spec错误所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。