GAE 找不到 httplib2

GAE not finding httplib2

我正在尝试 运行 示例代码 https://github.com/google/google-api-python-client/tree/master/samples/appengine 从 Google API Python 客户端在 Google 云平台上。启动测试应用程序后,我看到了这个错误:

ImportError: No module named httplib2

我检查了提供的云环境,它有可用的库

Requirement already satisfied (use --upgrade to upgrade): httplib2 in /usr/local/lib/python2.7/dist-packages

/google/go_appengine/lib/httplib2
/google/go_appengine/lib/httplib2/httplib2
/google/google_appengine/lib/httplib2
/google/google_appengine/lib/httplib2/httplib2
/google/google-cloud-sdk/.install/.backup/lib/third_party/httplib2
/google/google-cloud-sdk/.install/.backup/platform/bq/third_party/httplib2
/google/google-cloud-sdk/.install/.backup/platform/gsutil/third_party/httplib2
/google/google-cloud-sdk/.install/.backup/platform/gsutil/third_party/httplib2/python2/httplib2
/google/google-cloud-sdk/.install/.backup/platform/gsutil/third_party/httplib2/python3/httplib2
/google/google-cloud-sdk/lib/third_party/httplib2
/google/google-cloud-sdk/platform/bq/third_party/httplib2
/google/google-cloud-sdk/platform/google_appengine/lib/httplib2
/google/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2
/google/google-cloud-sdk/platform/gsutil/third_party/httplib2
/google/google-cloud-sdk/platform/gsutil/third_party/httplib2/python2/httplib2
/google/google-cloud-sdk/platform/gsutil/third_party/httplib2/python3/httplib2
/home/MY_USER/src/triple-carrier-142807/python_gae_quickstart-2016-09-08-10-47/httplib2
/usr/local/lib/python2.7/dist-packages/httplib2

我可以在python命令行中导入:

Python 2.7.9 (default, Mar  1 2015, 12:57:24) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import httplib2
>>> 

必须安装它,但 GAE 无法识别它。

我自己修复了它,将 httplib2 放入引擎中(app.yaml 所在的目录)。