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

KeyError: '_module' #5

Closed
abnx opened this issue Aug 8, 2018 · 7 comments
Closed

KeyError: '_module' #5

abnx opened this issue Aug 8, 2018 · 7 comments

Comments

@abnx
Copy link

abnx commented Aug 8, 2018

$ python uds.py list
Traceback (most recent call last):
  File "uds.py", line 397, in <module>
    main()
  File "uds.py", line 352, in main
    creds = store.get()
  File "C:\Program Files\Python36\lib\site-packages\oauth2client\client.py", line 407, in get
    return self.locked_get()
  File "C:\Program Files\Python36\lib\site-packages\oauth2client\file.py", line 54, in locked_get
    credentials = client.Credentials.new_from_json(content)
  File "C:\Program Files\Python36\lib\site-packages\oauth2client\client.py", line 302, in new_from_json
    module_name = data['_module']
KeyError: '_module'

installed all modules with 'pip install -r requirements.txt'
python 3.6

i generated a credentials.json from the linked google api page and downloaded it to the uds directory. this gave me an error so i renamed it to client_secrets.json like the readme suggests. am i doing something wrong? or it looks like oauth2client has problems? maybe i generated my credentials files wrong since it doesnt contain '_module'?
pls help

@DessertArbiter
Copy link

i also get this error

@stewartmcgown
Copy link
Owner

Could be because you named it 'client_secrets' and not 'client_secret'? If not I'll need to look into it more.

@plato79
Copy link

plato79 commented Dec 5, 2018

I also got the same error, and I'm sure it's "client_secret.json"..

@stewartmcgown
Copy link
Owner

Consensus on overflow seems to be that the keyerror is caused by incorrect JSON file. What is the structure of your JSON file? (Without any secrets showing)

@DessertArbiter
Copy link

i updated it and now it works

@DessertArbiter
Copy link

i think the reason it wasnt working before was that i didnt run it without arguments first

@ThatIsAPseudo
Copy link

Note that you may get the same issue if the file is minified ; beautify it and it will work.

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

5 participants