我在Google App Engine的Python中得到了这个错误,Python使用了Google Translate API, 但我不知道怎么解决
<module>
from apiclient.discovery import build
ImportError: No module named apiclient.discovery
我将尝试设置环境,它向Google App Engine SDK指示, 然后再次上传到Google Apps Engine,总是会得到错误信息
Error: Server 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.
请告诉我怎么修理
谢谢
更新:已修复 在倪进的帮助下, 我通过添加以下文件夹修复了问题
apiclient, gflags, httplib2, oauth2client, uritemplate
apiclient
不在appengine运行时提供的第三方库列表中:http://developers.google.com/appengine/docs/python/tools/libraries27。您需要将
apiclient
复制到项目目录中,还需要复制这些uritemplate
&;httplib2
。注意:文档列表中未提供的任何第三方库都必须复制到appengine项目目录
apiclient
是库的原始名称。在某个时刻,它被转换为
googleapiclient
。如果你的代码在Google App Engine上运行,两者都应该可以工作。
如果您自己运行应用程序,并且安装了google-api-python-client,那么两者都应该可以正常工作。
尽管,如果我们看一下the source code of the ^{} package's ^{} module ,我们可以看到
apiclient
模块只是为了向后兼容而保留的。因此,您确实应该在代码中使用
googleapiclient
,因为apiclient
别名的维护只是为了不破坏遗留代码。您应该能够通过这个简单的安装获得这些依赖项:
这在quick start page for python上有描述。
相关问题 更多 >
编程相关推荐