question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: module 'gspread' has no attribute 'service_account'

See original GitHub issue

Hello, I just installed gspread in Google Collaboratory:

pip install gspread

Then I tried to run the code following the instructions:

import gspread

gc = gspread.service_account()

output:
AttributeError: module 'gspread' has no attribute 'service_account'

Thank you

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
rahul-soshtecommented, Apr 1, 2021

Don’t name any of your files inside your directory as gspread.py. I had named the same thing and it was giving me an error. I changed the name to something else and it worked.

1reaction
burnashcommented, Oct 9, 2020

In this case, you’d need to upgrade gspread, as service_account() was added in 3.6.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: module 'gspread' has no attribute 'open_by_key'
Once the auth is complete, you can verify it by using python's built in function dir. Example: Service account: import gspread gc =...
Read more >
gspread Documentation - Read the Docs
A service account is a special type of Google account intended to represent a non-human user that needs to authenticate.
Read more >
Why am I getting 'AttributeError: module 'gspread' has ... - Quora
In your notebook, you are importing a module called [code ]gspread[/code], and are trying to access a module attribute from it, which does...
Read more >
gspread 5.7.0 documentation
gspread is a Python API for Google Sheets. Features: Google Sheets API v4. Open a spreadsheet by title, key or url. Read, write...
Read more >
module 'gspread' has no attribute 'service_account'
AttributeError : module 'gspread' has no attribute 'service_account' ... Hello, I just installed gspread in Google Collaboratory:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found