为什么使用 Translate API 的 Python App Engine 应用程序会收到 ImportError 错误:没有名为 apiclient.discovery 的模块?

为什么使用 Translate API 的 Python App Engine 应用程序会收到 ImportError 错误:没有名为 apiclient.discovery 的模块?

问题描述:

我在 Google App Engine 的 Python 中遇到了这个错误,我使用了 Google Translate API,但我不知道如何解决,

I got this error in Google App Engine's Python have used Google Translate API, But I don't know how to fix,

<module>
from apiclient.discovery import build
ImportError: No module named apiclient.discovery

我将尝试设置向 Google App Engine SDK 指示的环境,然后再次上传到 Google Apps Engine,总是报错

I'll try to set environment which indicates to Google App Engine SDK, And upload to Google Apps Engine again, always get the error,

错误:服务器错误

服务器遇到错误,无法完成您的请求.如果问题仍然存在,请报告您的问题并提及此错误消息和导致该问题的查询.

The server encountered an error and could not complete your request. If the problem persists, please report your problem and mention this error message and the query that caused it.

请告诉我如何修复

谢谢

更新:已修复在 Nijjin 的帮助下,我通过添加以下文件夹解决了问题,

UPDATE : Fixed Follow Nijjin's help, I fixed problems by adding the following folders,

apiclient、gflags、httplib2、oauth2client、uritemplate

如果您仍然遇到问题,请参考本页下面的答案以获取更多信息.前任.: Varum 回答等...

您应该能够通过这个简单的安装获得这些依赖项:

You should be able to get these dependencies with this simple install:

sudo pip install --upgrade google-api-python-client

这在 python 快速启动页面中有所描述.