Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ezgmail.init() error & not logged in despite having token.json and credentials.json #32

Closed
adotterer opened this issue May 24, 2021 · 1 comment

Comments

@adotterer
Copy link

I followed the Python quickstart guide for the Gmail API and successfully got my credentials.json and token.json. When I run quickstart.py I do get all my email labels, so that seems to have worked.

I'm running on MacOs and pip3 installed ezgmail, etc but keep running into this error when I run:

import ezgmail
ezgmail.init()

(also ezgmail.init(tokenFile="token.json", credentialsFile="credentials.json") gives me the same error)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/adott/.pyenv/versions/3.8.3/lib/python3.8/site-packages/ezgmail/__init__.py", line 471, in init
    creds = store.get()
  File "/Users/adott/.pyenv/versions/3.8.3/lib/python3.8/site-packages/oauth2client/client.py", line 407, in get
    return self.locked_get()
  File "/Users/adott/.pyenv/versions/3.8.3/lib/python3.8/site-packages/oauth2client/file.py", line 54, in locked_get
    credentials = client.Credentials.new_from_json(content)
  File "/Users/adott/.pyenv/versions/3.8.3/lib/python3.8/site-packages/oauth2client/client.py", line 302, in new_from_json
    module_name = data['_module']
KeyError: '_module'

In Python when I import and run ezgmail.LOGGED_IN I get false back.

I have also tried running this in a .py file with no luck:

import ezgmail
import os
os.chdir(r'/Users/adott/Documents/PROJECTS/abswpy/')  # location of the .json files
ezgmail.init()
print(ezgmail.LOGGED_IN)

Any help would be greatly appreciated! Thank you :)

@adotterer
Copy link
Author

Fixed by installing the package in a virtual environment !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant