No module named google_auth_httplib2

343 views
Skip to first unread message

Seb Taylor via StackOverflow

unread,
Feb 7, 2017, 1:25:05 AM2/7/17
to google-appengin...@googlegroups.com

Goal: Use GAE with Python and Google Cloud Storage to store and serve an image more efficiently to ultimately use the image API.

Problem: Cannot find correct modules (httplib2 and six) despite successful install.


Run time example

Python Code Sample A:

from google.cloud import storage
from google.appengine.api import app_identity
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
import webapp2

Returns Sample A:

ImportError: No module named google_auth_httplib2

Note: Also had a similar error for six. "no module named six"


Install Details

python installed at: C:\Python27

six installed at: C:\python27\lib\site-packages\six-1.10.0-py2.7.egg

httplib2 installed at: C:\Python27\Lib\site-packages\httplib2-0.9.2-py2.7.egg-info

Running “C:>pip install httplib2” in the command line returns: “Requirement already satisfied: httplib2 in c:\python27\lib\site-packages”

Running “C:>pip install six” in the command line returns: Requirement already satisfied: six in c:\python27\lib\site-packages\six-1.10.0-py2.7.egg

GAE Cloud Storage Client installed at: C:\Python27\Lib\site-packages\GoogleAppEngineCloudStorageClient-1.9.22.1-py2.7.egg-info

GAE SDK Server Hosting using "dev_appserver.py ." at: C:\Users\sebastian\Documents\Web Projects\Cookbook This location also contains the app.yaml file.

Copied modules to app.yaml location Copied the httplib2 and six-1.10.0-py2.7.egg folders to my app.yaml directory.


Appendix 1:

App.yaml (Shown here in single line format for ease of presentation.)

runtime: python27 api_version: 1 threadsafe: true

handlers: - url: / script: homegcs.app

  • url: /static static_dir: static

  • url: /.* script: home.app

  • url: /index.html script: home.app

  • url: /stylesheets static_dir: stylesheets

  • url: /(..(gif|png|jpg))$ static_files: static/\1 upload: static/..(gif|png|jpg)$

  • url: /admin/.* script: admin.app login: admin

  • url: /.* script: not_found.app



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/42083023/no-module-named-google-auth-httplib2

Seb Taylor via StackOverflow

unread,
Feb 7, 2017, 1:35:05 AM2/7/17
to google-appengin...@googlegroups.com

Goal: Use GAE with Python and Google Cloud Storage to store and serve an image more efficiently to ultimately use the image API.

Problem: Cannot find correct modules (httplib2 and six) despite successful install.


Run time example

Python Code Sample A:

from google.cloud import storage
from google.appengine.api import app_identity
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
import webapp2

Returns Sample A:

ImportError: No module named google_auth_httplib2

Note: Also had a similar error for six. "no module named six"


Installed Details



- url: /static
  static_dir: static

- url: /.*
  script: home.app

- url: /index\.html
  script: home.app

- url: /stylesheets
  static_dir: stylesheets

- url: /(.*\.(gif|png|jpg))$
  static_files: static/\1
  upload: static/.*\.(gif|png|jpg)$

- url: /admin/.*
  script: admin.app
  login: admin

- url: /.*
  script: not_found.app

Seb Taylor via StackOverflow

unread,
Feb 7, 2017, 1:40:05 AM2/7/17
to google-appengin...@googlegroups.com
runtime: python27

    api_version: 1
    threadsafe: true

handlers:

    - url: /
      script: homegcs.app


    - url: /static
      static_dir: static

    - url: /.*
      script: home.app

    - url: /index\.html
      script: home.app

    - url: /stylesheets
      static_dir: stylesheets

    - url: /(.*\.(gif|png|jpg))$
      static_files: static/\1
      upload: static/.*\.(gif|png|jpg)$

    - url: /admin/.*
      script: admin.app
      login: admin

    - url: /.*
      script: not_found.app

GAEfan via StackOverflow

unread,
Feb 7, 2017, 1:40:07 AM2/7/17
to google-appengin...@googlegroups.com

Your packages either need to be uploaded with the project, or added in app.yaml, if they are available in App Engine. six is an available library, so, in app.yaml, add:

libraries:
- name: six
  version: "1.9.0"

If you put the httplib2 package at the same level as app.yaml, it should upload with the project, and be available in production.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/42083023/no-module-named-google-auth-httplib2/42083255#42083255

GAEfan via StackOverflow

unread,
Feb 7, 2017, 1:50:05 AM2/7/17
to google-appengin...@googlegroups.com

Your packages either need to be uploaded with the project, or added in app.yaml, if they are available in App Engine. six is an available library, so, in app.yaml, add:

libraries:
- name: six
  version: "1.9.0"

If you put the httplib2 package at the same level as app.yaml, it should upload with the project, and be available in production.

Another user added google_auth_httplib2 as a package as well, and uploaded it with the project. Though I think that should be available directly:

Module google_auth_httplib2 not found after pip installing google-cloud How can I fix it?

Seb Taylor via StackOverflow

unread,
Feb 7, 2017, 2:00:08 AM2/7/17
to google-appengin...@googlegroups.com

GAEfan via StackOverflow

unread,
Feb 7, 2017, 2:00:11 AM2/7/17
to google-appengin...@googlegroups.com

Your packages either need to be uploaded with the project, or added in app.yaml, if they are available in App Engine. six is an available library, so, in app.yaml, add:

libraries:
- name: six
  version: "1.9.0"

If you put the httplib2 package at the same level as app.yaml, it should upload with the project, and be available in production.

Another user added google_auth_httplib2 as a package as well, and uploaded it with the project. Though I think that should be available directly:

Module google_auth_httplib2 not found after pip installing google-cloud How can I fix it?

** You also have an issue in your url handlers in app.yaml. This is a wildcard for all urls:

- url: /.*
    script: home.app

So, every handler below that will not ever be hit.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/42083023/no-module-named-google-auth-httplib2/42083255#42083255

Seb Taylor via StackOverflow

unread,
Feb 7, 2017, 11:30:05 PM2/7/17
to google-appengin...@googlegroups.com


    - url: /static
      static_dir: static

    - url: /.*
      script: home.app

    - url: /index\.html
      script: home.app


    - url: /stylesheets
      static_dir: stylesheets

    - url: /(.*\.(gif|png|jpg))$
      static_files: static/\1
      upload: static/.*\.(gif|png|jpg)$

    - url: /admin/.*
      script: admin.app
      login: admin

    - url: /.*
      script: not_found.app

Folder structure containing App.yaml

Yamil Abugattas via StackOverflow

unread,
Feb 10, 2017, 3:15:10 PM2/10/17
to google-appengin...@googlegroups.com

You need to install google-cloud in your project, like this:

pip install google-cloud -t [my_project]/lib/google-cloud

Make sure you create that google-cloud folder first, inside your lib folder. Once you do that, change or create appengine_config.py (in /my_project) and include this:

from google.appengine.ext import vendor

vendor.add('lib/google-cloud')

Everything shoul work now.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/42083023/no-module-named-google-auth-httplib2/42167930#42167930
Reply all
Reply to author
Forward
0 new messages