janja-janja / gmail-api-wrapper

Gmail API Wrapper - A Python Client
https://pypi.python.org/pypi/gmail-api-wrapper/
Other
26 stars 2 forks source link

Cannot Read Credential Files #13

Open arlcurten opened 5 years ago

arlcurten commented 5 years ago

Hi, I followed the instruction downloading credential file and rename it as "client_secret.json" before putting it into ~/.credentials/ directory. However, Still met a problem when initialize a object from GmailAPIReadWrapper(). Any idea to solve the problem? Thanks. (Ubuntu 16.0.4)

Python 3.7.0 (default, Jun 28 2018, 13:15:42) [GCC 7.2.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

from gmail_api_wrapper.crud.read import GmailAPIReadWrapper

gmail_api = GmailAPIReadWrapper() Traceback (most recent call last): File "", line 1, in File "/home/Tai-chunWei/workspace/gmail-api-wrapper/gmail_api_wrapper/crud/read.py", line 75, in init self.gmail_api = GmailAPIConnection().gmail_api_connect() File "/home/Tai-chunWei/workspace/gmail-api-wrapper/gmail_api_wrapper/connection.py", line 115, in gmail_api_connect service = google_api.get_service() File "/home/Tai-chunWei/workspace/gmail-api-wrapper/gmail_api_wrapper/connection.py", line 97, in get_service creds = self._get_credentials() File "/home/Tai-chunWei/workspace/gmail-api-wrapper/gmail_api_wrapper/connection.py", line 83, in _get_credentials credentials = store.get() File "/home/Tai-chunWei/anaconda3/lib/python3.7/site-packages/oauth2client/client.py", line 407, in get return self.locked_get() File "/home/Tai-chunWei/anaconda3/lib/python3.7/site-packages/oauth2client/file.py", line 54, in locked_get credentials = client.Credentials.new_from_json(content) File "/home/Tai-chunWei/anaconda3/lib/python3.7/site-packages/oauth2client/client.py", line 302, in new_from_json module_name = data['_module'] KeyError: '_module'

ghost commented 5 years ago

Try this issue post https://github.com/yoda-yoda/gmail-api-wrapper/issues/11

chuangjim commented 4 years ago

@arlcurten i've faced same problem as you, have you solved yet? i've tried:

  1. change .json filename
  2. move .json file to current folder
  3. export GAW_CLIENT_SECRET_FILE_PATH
  4. use python2.7 instead of python3.6 none of above worked for me....