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.

In Jupyter notebook module 'gspread' has no attribute 'authorize'

See original GitHub issue

Im getting the above error when trying to use gspread from a jupyter notebook.

Environment info

Operating System: windows 10 Python version: 3.5.2 gspread version: 0.6.2 installed from pip

My code

import gspread
from oauth2client.service_account import ServiceAccountCredentials

scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name(r'C:\Users\james\mykey.json', scope)
gc = gspread.authorize (credentials)

This results in:

AttributeError                            Traceback (most recent call last)
<ipython-input-109-71ba1615f471> in <module>()
      4 scope = ['https://spreadsheets.google.com/feeds']
      5 credentials = ServiceAccountCredentials.from_json_keyfile_name(r'C:\Users\james\VividVision-5b8596511cfc.json', scope)
----> 6 gc = gspread.authorize (credentials)
      7 
      8 #gc = client.open_by_key ('Gardening Data')

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

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
burnashcommented, Mar 19, 2017

Do you have any files named gspread.py or directory called gspread in your working directory?

0reactions
muzahid19deccommented, Oct 23, 2020

[‘Cell’, ‘CellNotFound’, ‘Client’, ‘GSpreadException’, ‘IncorrectCellLabel’, ‘NoValidUrlKeyFound’, ‘Spreadsheet’, ‘SpreadsheetNotFound’, ‘Worksheet’, ‘WorksheetNotFound’, ‘author’, ‘builtins’, ‘cached’, ‘doc’, ‘file’, ‘loader’, ‘name’, ‘package’, ‘path’, ‘spec’, ‘version’, ‘authorize’, ‘client’, ‘exceptions’, ‘models’, ‘urls’, ‘utils’] 3.0.1 on google colab

[‘Cell’, ‘CellNotFound’, ‘Client’, ‘GSpreadException’, ‘IncorrectCellLabel’, ‘NoValidUrlKeyFound’, ‘Spreadsheet’, ‘Spreadsh eetNotFound’, ‘Worksheet’, ‘WorksheetNotFound’, ‘author’, ‘builtins’, ‘cached’, ‘doc’, ‘file’, ‘loade r’, ‘name’, ‘package’, ‘path’, ‘spec’, ‘version’, ‘auth’, ‘authorize’, ‘client’, ‘exceptions’, ‘model s’, ‘oauth’, ‘service_account’, ‘urls’, ‘utils’] 3.6.0 on IDE

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: module 'gspread' has no attribute 'open_by_key'
I am trying to access a spreadsheet from python using gspread, but keep getting an attribute error. open_by_url ...
Read more >
gspread Documentation - Read the Docs
Simple authentication with OAuth. gspread.auth.authorize(credentials, client_factory=<class gspread.client.Client>). Login to Google API using ...
Read more >
Release 3.7.0 Anton Burnashev - gspread Documentation
A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized...
Read more >
AttributeError: partially initialized module has no attribute ...
The solution is not to name the Python file the same as any of the modules being imported in that Python file. Related....
Read more >
gspread worksheet.update error : r/learnpython - Reddit
AttributeError: 'Worksheet' object has no attribute 'update' ... (most recent call last) <ipython-input-132-e085af26b2ed> in <module>() 21 ...
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