1

When I do :

from oauth2client.client import SignedJwtAssertionCredentials

in my main.py which is served using the App Engine development server, I am getting an error :

ImportError: cannot import name SignedJwtAssertionCredentials

When I ran from a standard python console the same statement, I am not getting any error. The import works fine.

I confirm that I have pyopenssl installed on my system. I have already read this post which suggest only to install it: ImportError: cannot import name SignedJwtAssertionCredentials

Any idea of what's wrong with the development server?

PS : My main goal is to connect to BigQuery

Community
  • 1
  • 1
poiuytrez
  • 21,330
  • 35
  • 113
  • 172
  • possible duplicate of [ImportError: cannot import name SignedJwtAssertionCredentials](http://stackoverflow.com/questions/14063124/importerror-cannot-import-name-signedjwtassertioncredentials) – Pentium10 Jan 28 '15 at 12:20
  • @Pentium10 I noticed already this other thread. However, I have pyopenssl installed an it is working properly in the python console. My issue is specifically with Google App Engine. – poiuytrez Jan 28 '15 at 13:05
  • https://developers.google.com/identity/protocols/OAuth2ServiceAccount#authorizingrequests example code in google documentation – Virako Jun 02 '16 at 04:55

1 Answers1

1

Instead of using SignedJwtAssertionCredentials and deploying your PKCS12 key with your application, you can use AppAssertionCredentials from the oauth2client.appengine package. Ensure that your appengine application service is added to your project and you are good to go.

Looks like a long standing issue with the AppEngine environment: https://code.google.com/p/google-api-python-client/issues/detail?id=133

Michael Sheldon
  • 2,027
  • 11
  • 7