Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Spreadsheets API: 'SpreadsheetsClient' object has no attribute 'update_cell'

For some reason, when I'm trying to update one cell using the Google Spreadsheets API in Python, like so:

import gdata.spreadsheets.client 
import gdata.gauth

gd_client = gdata.spreadsheets.client.SpreadsheetsClient()
gd_client.auth_token = gdata.gauth.OAuth2TokenFromCredentials(credentials)

wksht_id = od6

gd_client.update_cell(spreadsheet_k, wksht_id, 3, 17, 'TEST')

I get this error:

AttributeError: 'SpreadsheetsClient' object has no attribute 'update_cell'

Even though in the source code for client.py, update_cell is very clearly a method for the SpreadsheetsClient class: https://code.google.com/p/gdata-python-client/source/browse/src/gdata/spreadsheets/client.py

This cell has something in it, if that makes any difference. But that's not where the error is coming from. I just have no idea why this isn't working. Maybe something to do with different versions of the API?

What am I not seeing?

like image 986
HLH Avatar asked Aug 07 '26 09:08

HLH


1 Answers

Figured it out! Turns out the source code was updated with the update_cell method but the gdata downloads were never given this method for some reason. You have to go to the source code and copy the method over to your own copy of gdata, or use this workaround: https://gist.github.com/egor83/4634422

like image 149
HLH Avatar answered Aug 08 '26 23:08

HLH



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!