Ok I'm following along with the Become A Technical Marketer course and I'm trying to learn how to manage Google Spreadsheets with GSpread. I've followed along with the documentation at http://gspread.readthedocs.io/en/latest/oauth2.html. I've followed the steps in the second URL above and ran a document with the following code:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('DFS Google Sheets Data Imports-7205de852ff7.json', scope)
gc = gspread.authorize(credentials)
wks = gc.open("Authority Scraper").sheet1
wks.update_cell(1,2,"Hello World!")
From that I get the error in my terminal: from oauth2client.service_account import ServiceAccountCredentials ImportError: No module named oauth2client.service_account
Someone please help me. The answers with other No module named oath2client.service_account are not working for me. Thanks!
pip install --upgrade oauth2client
run without errors ? – BaudelaireSignedJwtAssertionCredentials
was deprecated inoauth2client
andgspread
moved toServiceAccountCredentials
as well. As suggested, you could have a mismatch between your version ofoauth2client
and its supported login mechanism, so update it to newest version forServiceAccountCredentials
or useSignedJwtAssertionCredentials
(old method) with your existing version. – Timelaggspread
tag is also directly related, so viewers of this question might also be interested in another manifestation of errors that arise from this change. I had a typo in my github link too. It's: github.com/burnash/gspread/issues/357 – Timelagpip install --ignore-installed six
– Baudelaire