【发布时间】:2016-04-15 07:28:59
【问题描述】:
我正在 Windows PC 上试用 GAE Python 应用程序。在使用以下代码时,我遇到了No crypto library available 错误:
from oauth2client.client import SignedJwtAssertionCredentials
json_key=json.load(open('DriveCredentials.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'].encode(), scope)
根据this,我需要安装PyOpenSSL。我这样做了,但仍然得到同样的错误。从这个Google Groups conversation,假设它在Windows 环境中无法工作,因为crypt 模块在Windows 中不可用。这是正确的吗?
我将项目部署到 GAE,尽管无法在我的本地 PC 上运行,但它在 Google 的服务器上运行良好。
SignedJwtAssertionCredentials 无法在 Windows PC 上进行开发是已知问题吗?有解决办法吗?
我之前在另一个应用程序中的 Windows 上的 Python 3.4 环境中使用了上述相同的代码,并且运行良好。
【问题讨论】:
-
您是否在 app.yaml 文件中包含了 pycrypto 库?看到这个:stackoverflow.com/a/28539143/783657
-
是的。完全相同的文件无法在我的 PC 上运行,但如果推送到 Google App Engine 运行良好。
-
PyCrypto和PyOpenSSL是什么关系?
标签: python google-app-engine google-oauth