来自oauth2客户端.contrib.appengineimport AppAssertionCredentials ImportError:没有名为appengin的模块

2024-05-13 04:26:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我们正在尝试从oauth2client导入AppAssertionCredentials。我们使用的是python27标准google应用程序引擎。你知道吗

我们的外表_配置.py具体如下

from google.appengine.ext import vendor

# Add any libraries installed in the "lib" folder.
vendor.add('lib')

我们其中一个模块中的import语句是这样的。你知道吗

 # from oauth2client.appengine import AppAssertionCredentials
 import httplib2
 from oauth2client.client import GoogleCredentials
 from oauth2client.contrib.appengine import AppAssertionCredentials

我们检查了应用程序中的“lib”文件夹。它有oauth2client。它还有一个contrib,它有appengine.py公司文件。我们执行了以下操作来安装我们的需求。你知道吗

google-endpoints==4.8.0
google-endpoints-api-management==1.11.0
apiclient
firebase_admin
sendgrid==5.2.0
google.auth
jinja2
pytz
stripe
twilio
httplib2
oauth2client==3.0.0
GoogleAppEngineCloudStorageClient

因为某种原因当我们执行端点cfg.py它抛出了这个错误。这个端点cfg.py来自here。 来自oauth2客户端.contrib.appengineimport AppAssertionCredentials ImportError:没有名为appengine的模块

更新

我们的附录yaml详情如下—

runtime: python27
api_version: 1
threadsafe: true
instance_class: F2
automatic_scaling:
  max_instances: 100
  min_pending_latency: 30ms  # default value
  max_pending_latency: automatic

libraries:
- name: webapp2
  version: latest  
- name: jinja2
  version: latest
- name: pycrypto
  version: 2.6
- name: PIL
  version: 1.1.7
- name: ssl
  version: 2.7.11


inbound_services:
- channel_presence

handlers:

- url: /stylesheets
  static_dir: stylesheets

- url: /images
  static_dir: images

- url: /javascripts
  static_dir: javascripts

- url: /static
  static_dir: static
  application_readable: true 


- url: /sakthihemaadmin
  script: main.app
  secure: always

- url: /sakthihemaadmindisplay
  script: main.app  

- url: /signup
  script: main.app
  secure: always

- url: /login
  script: main.app
  secure: always

- url: /forgot
  script: main.app
  secure: always

- url: /initprogram
  script: main.app
  secure: always

- url: /debugprogram
  script: main.app
  secure: always


# Endpoints handler: this must be /_ah/spi for Endpoints, NOT /_ah/api!
- url: /_ah/api/.*
  # script: cloudendpointapi.APPLICATION
  script: main.api

# Required for deferred 
- url: /_ah/queue/deferred
  script: google.appengine.ext.deferred.deferred.application
  login: admin


- url: .*
  script: main.app 

我们不创建OpenAPI文档,而是创建here所列的客户机库。你知道吗

 endpointscfg.py get_discovery_doc

Tags: namepyimportapiappurlmainversion
1条回答
网友
1楼 · 发布于 2024-05-13 04:26:16

而不是使用端点cfg.py获取发现文档请使用$lib/endpoints/端点cfg.py. 你知道吗

我想还有另一个版本的端点cfg.py在我的环境中引起了这个问题。你知道吗

这帮助我解决了这个问题。你知道吗

相关问题 更多 >