Search code examples
python-2.7google-app-enginehttplib2

GAE not finding httplib2


I'm trying to run the sample code https://github.com/google/google-api-python-client/tree/master/samples/appengine from the Google API Python Client on the Google Cloud platform. After starting the test app I'm seeing this error:

ImportError: No module named httplib2

I checked the cloud env provided and it has the lib available

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

I can import it in the python command line:

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
>>> 

It must be installed but GAE is not recognizing it.


Solution

  • I fixed it myself by putting httplib2 in the engine dir (the dir where app.yaml exists).