1

我正在关注本教程 https://developers.google.com/bigquery/articles/dashboard#downloadinstalllibraries

他们在这里说

cd source/
enable-app-engine-project hellodashboard/

这会将大约 60 个文件复制到项目目录中。但我只看到复制了大约 10 个文件。项目目录中的 oauth2client 文件夹只有__init__.py文件,因为我正在使用

from oauth2client.appengine import oauth2decorator_from_clientsecrets

当我运行我的程序时,它显示一个错误

from oauth2client.appengine import oauth2decorator_from_clientsecrets
ImportError: No module named appengine

所以我手动将所有文件从 oauth2client zip 复制到项目 oauth2client 目录。现在,当我运行我的程序时,它没有显示任何错误并且似乎运行良好。是 enable-app-engine-project 命令弄乱了一些东西还是我做错了什么。

4

1 回答 1

1

enable-app-engine-project尝试根据本地系统上安装模块的路径来定位源。您是否在本地安装了这些模块?

作为替代方案,您可以简单地将以下目录手动复制到您的 App Engine 项目中:

SOURCES = [
    'gflags',
    'gflags_validators',
    'httplib2',
    'oauth2client',
    'oauth2',
    'apiclient',
    'uritemplate',
    ]
于 2012-11-08T22:15:48.880 回答