【问题标题】:ImportError: cannot import name SignedJwtAssertionCredentials using AppEngine dev serverImportError:无法使用 AppEngine 开发服务器导入名称 SignedJwtAssertionCredentials
【发布时间】:2015-03-27 06:59:54
【问题描述】:

当我这样做时:

from oauth2client.client import SignedJwtAssertionCredentials

在使用 App Engine 开发服务器提供服务的 main.py 中,出现错误:

ImportError: cannot import name SignedJwtAssertionCredentials

当我从标准 python 控制台运行相同的语句时,我没有收到任何错误。导入工作正常。

我确认我的系统上安装了 pyopenssl。我已经阅读了这篇建议只安装它的帖子:ImportError: cannot import name SignedJwtAssertionCredentials

知道开发服务器出了什么问题吗?

PS:我的主要目标是连接到 BigQuery

【问题讨论】:

标签: python google-app-engine google-bigquery


【解决方案1】:

您可以使用oauth2client.appengine 包中的AppAssertionCredentials,而不是使用SignedJwtAssertionCredentials 并将PKCS12 密钥部署到您的应用程序中。确保您的 appengine 应用程序服务已添加到您的项目中并且一切顺利。

AppEngine 环境似乎是一个长期存在的问题:https://code.google.com/p/google-api-python-client/issues/detail?id=133

【讨论】:

    猜你喜欢
    • 2012-12-13
    • 1970-01-01
    • 1970-01-01
    • 2018-01-10
    • 2019-07-14
    • 2011-07-19
    • 1970-01-01
    • 1970-01-01
    • 2019-11-19
    相关资源
    最近更新 更多