Python 从oauth2client.contrib.appengine导入AppAssertionCredentials导入错误:没有名为appengine的模块
我们正在尝试从oauth2client导入AppAssertionCredentials。我们使用的是python27标准的谷歌应用程序引擎 我们的appengine_config.py如下所示Python 从oauth2client.contrib.appengine导入AppAssertionCredentials导入错误:没有名为appengine的模块,python,google-app-engine,Python,Google App Engine,我们正在尝试从oauth2client导入AppAssertionCredentials。我们使用的是python27标准的谷歌应用程序引擎 我们的appengine_config.py如下所示 from google.appengine.ext import vendor # Add any libraries installed in the "lib" folder. vendor.add('lib') 我们其中一个模块中的import语句如下所示 # from oauth2clie
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
出于某种原因,当我们执行endpointscfg.py时,它会抛出此错误。endpointscfg.py来自。
从oauth2client.contrib.appengine导入AppAssertionCredentials导入错误:没有名为appengine的模块
更新
我们的app.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文档,而是在创建所列的客户端库
请使用$lib/endpoints/endpointscfg.py,而不是使用endpointscfg.py get_discovery_doc 我猜在我的环境中有另一个版本的endpointscfg.py导致了这个问题
这帮助我解决了问题。更新:链接不正确。您能否提供一个示例,说明您在执行以下命令时是如何执行的。你的app.yaml看起来像什么?通过使用$lib/endpoints/endpointscfg.py而不是endpointscfg解决了这个问题。py@Jacktileman请将解决方案作为答案发布,这将对社区有所帮助
endpointscfg.py get_discovery_doc