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
Index error list index out of range - pygsheets #261
Comments
what is the version of your pygsheets? |
Sorry, how to get version? |
I downloaded this from yours https://github.com/nithinmurali/pygsheets |
how did you install pygsheets? |
pip install |
Python 3.5 |
Okay, this error means, there is no spreadsheet with the given name. are you sure there is a sheet with the name |
I have my own drive where it works perfect. Only in my wife's drive I am getting this problem. Also it opens with both gc.open_by_key & gc.open_by_url . But when I try gc.open("chitra") it gives problem(chitra is the name of the sheet). |
With gspread it is getting opened. credentials = ServiceAccountCredentials.from_json_keyfile_name('ChitraGTCS-eb21b5753afc.json', scope) |
When you use the same service account credentials also you cant open in pygsheets? |
Thank you so much for devoting your valuable time. Sorry for disturbing you. It is my first ever GitHub query. Your module pygheets is excellant |
When you use the same service account credentials also you cant open in pygsheets? |
But my wife's email chitra@gatewaytheschool.in belong to school. May be that is the issue |
But this sheet belong to her ie she is the owner |
As described in docs, if you wanna access your wife's account make sure the oauth credentials are generated from her account. Else create a service creds and share the sheet to that email. |
One more thing. My account i was asked for credential authorisation to handle sheets and drive. But i did not receive such thing when I created service account in her login and tried to run the python file. |
It is supposed to ask her login. |
Thank you so much. Let me try |
Else you can also try to use that service account which worked with gspread like this
|
Thank you so much. It is working perfect. ### Can I try to open another sheet in the same location? |
Suppose I have two sheets in the same drive, do I need two seperate Service account json files? |
okay cool. Now it should work for any sheet in her account. No but all those sheets should be shared with the first service account. Its better to use outh credentials, as then you can acess any sheet in her account. |
Thank you so much. Let me keep it open this issue few more hours, if you permit so. I have few more queries |
Hi @Aruloli For security reasons I would delete the picture of the credentials library and your wifes email address. Additionally delete the API Keys you generated as they are now public and can be used by anyone to access your wifes account, via API. The other credentials are not necessarily compromised, but I would still re-generate all of them, just to be sure. And delete the picture of the sheet with personal names & information in it. This is a public forum... |
True that @Kordishal |
And the comment with to the sheet. By posting a sheet link, you share it publicly. I could just delete all the information in it. |
I agree with you. I just deleted the API keys also which I created without knowing the purpose |
Also @Aruloli, for usage questions please use stackoverflow with |
I got it. I tried many tags in stackoverflow but failed to get a solution for 2 consecutive days |
Ohh i see. I am subscribed to the pygsheets tag, so if you use it i would get a notification in few mins. |
Pl give a link on Complete Task flow of creating Service account>> Give permissions>> Open google sheets. If I could not get your connection I would have dropped this project. Thank you so much. |
See the docs, http://pygsheets.readthedocs.io/en/latest/authorizing.html everything is explained there. Also use the staging version of pygsheets, many issues are fixed there, |
gc = pygsheets.authorize(outh_file='client_secretxxx.json') |
No where I got a clear cut guidance on how to go about except yours |
NO, Use 1st one if you wanna use oauth authorization, 2 for service account . you only need one of it. |
After your advice i got very good clarity |
It got clicked when you advised me to put gc = pygsheets.authorize(service_file='service_creds.json') |
Hi! I will be deploying an app thru Heroku. Will this work? I used the authentication method and followed the link and copied it. Will this happen if I deployed it there? |
Hi I get a raise |
Hi, Please use Stackoverflow for usage questions. When using a service account you need to share your sheet with the service account email. And if you do ever post on GitHub again, open a new issue. I only saw this because of an E-Mail notification. Or if you do not want to create a new issue, you can re-open a closed issue. |
Noted. Thanks! |
Hi Nithin, How are you? My wife having few Google sheets with data asked me to make reports based those data. Before touching her drive, I tested your code in my drive first and it worked perfect. When i tried in my wife's google account it shows following error.
''ss = gc.open('chitra')
File "C:\Users\Aruloli\Python\pygsheets-staging\pygsheets\client.py", line 136, in open
spreadsheet = list(filter(lambda x: x['name'] == title, self.drive.spreadsheet_metadata()))[0]
IndexError: list index out of range''
When I open with gc.open_by_key & gc.open_by_url it works perfect but without many pygsheets methods
Pl help me. Arul
The text was updated successfully, but these errors were encountered: