-
Notifications
You must be signed in to change notification settings - Fork 952
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
gspread.exceptions.SpreadSheetNotFound #226
Comments
Also, just as an experiment (not sure the market price for this). I'll pay $1.50 in bitcoin to anybody that posts an answer which solves my problem. (yes that would pretty much mean I am the oracle in this contract, but it'll have to do unless you have a technological way of executing judgement for completion.) |
Try to share this spreadsheet with an email address listed in your oAuth credentials. (See #224) |
Sir Burnash, I can now update a google spreadsheet via code thanks to you. Please send me your BTC address and I'll send the coin. :) |
JFC why isn't this email sharing thing documented ANYWHERE?? I spent the last hour trying to figure out why my newly generated APP / key combination couldn't see anything. |
@Ralithune did you read the docs?
That's linked right in the oAuth2 section on the gspread GitHub's page. |
You're absolutely right - I found that line after I posted this. There are more than a few people confused about Oauth, and there isn't an official tutorial out there that talks about the Project / App essentially being a separate identity that only has access to objects that have been shared with it. Maybe we could be a little more verbose, or include that as a final step? It seems like kind of an important thing for anyone trying to accomplish something using Gspread. Thanks for your work on it by the way. |
I agree. This does make sense. |
@Ralithune could you check if this works better: 75b7764? |
@burnash That's much better. Personally, I'd have done a screenshot and a whole separate step, but the way you've written it there will get picked up by Google search terms for people running in to exactly the error you helped us through here. :) |
Thanks @burnash - The main trick is to share the google spreadsheet with the value of json_key['client_email'] |
@burnash I am creating spreadsheets on the the runtime using gdata client which runs into 1000's sometimes.Is there any way I can share the spreadsheets programmatically to the client email which we are talking about here.In a fix actually my code was working before this clientLogin shutdown and now all hell break loose :/ |
Thank you, @Zugar. That's what I get for not reading the docs all the way through. |
@RO-29 I'm not sure if it's possible, at least I haven't seen this in the Google API docs yet. If you find how to programmatically share the spreadsheet with the client, please post it here. I'll be happy to add it to the gspread. |
I have Google apps for work account and document sharing is restricted to users within the domain only. So if I try to share the spreadsheet with the service account email (the one inside the json client_email) - I get an error in Google apps that it is restricted from sharing documents outside of the domain. Any thoughts on how to go around this? |
I have a similar situation, but my company's google apps policy is not set You can have your administrator go through the steps to create an app under That's the only thing I can think of for your situation. For me, I just On Tue, Jul 28, 2015 at 11:30 AM, ashwan-iomedia notifications@github.com
|
@Ralithune thanks - I was able to get this to work! Not sure if the suggestion you made is what I ended up doing. For anyone in a same boat, these are the steps:
It worked for me without opening up the domain wide restrictions on our Google Drive setup. |
Do I need to have write access to the spreadsheet to do this? I've used the "Share" feature on a spreadsheet I do not have write access to, and I am unable to read it using gspread. |
@sharpobject, check out #145. There should be some 'read_only' type behavior but we need to decide on this interface. Basically the answer is "soon." |
Not fully reading the docs just bit me also. Would it be appropriate to add a message to the I realize that not every |
@ashwan-iomedia An alternative for avoiding having to share a spreadsheet with a service account email address in the first place is to not use a service account but create an OAuth 2.0 client ID and then use the workflow described in the Google Python API client library docs. You can pass the credentials obtained that way to |
i'm experiencing intermittent |
I think the email sharing step is still deeply buried in the instructions list. It could be moved from step 7 in Obtain OAuth2 credentials from Google Developers Console to basic-usage section as a 2nd step. Or the wording of the link should be changed at least, it is deceptive in its current form. Instead of Obtain OAuth2 credentials from Google Developers Console, it could be something like Obtain OAuth2 credentials and set Spreadsheet permissions (then instead of step 7, create a subsection for it --even if it is a single step. |
I had this problem too. You need to open the json key you downloaded in a text editor. Once you have done this, go back to your google spreadsheet and share it with "The email address in not the json code NOT your email account. Worked like a charm once I had done this |
@oztalha Since this issue comes up from time to time I have to agree with you. I like the second approach. Could you make PR for it? |
Closed == fixed? |
A Very Important Note from here : [https://docs.gspread.org/en/latest/oauth2.html#enable-api-access]
This means that you need to share the spreadsheet (by opening the spreadsheet and then clicking on the share button and then just paste the email id) with the "client_email" mail id which is provided in the JSON file that you got from google developer console eg:
if this is your JSON file then you need to copy the client_email that is |
I have done that still same issue persists |
|
I read a few of the other issues submitted, nothing seemed to work.
I think I have correctly imported the gspread and oauth2client modules, I run python 2.7.5, and then when I try gc.open("File") it returns a SpreadSheetNotFound error.
I have tried gc.open_by_key(), gc.open_by_url(), same error. Yes, the sheet does exist
Traceback (most recent call last):
File "./gspreadtest.py", line 22, in
ctacc = gc.open("ct").sheet1 ###Note: tried .Sheet1, .sheet1, and just gc.open("ct)
File "/home/ren/Desktop/gspreadtest/gspreadmaster/gspread/client.py", line 150, in open
raise SpreadsheetNotFound
gspread.exceptions.SpreadsheetNotFound
Note: this is my first time posting on github, thanks for the great api, if I can get it working :).
The text was updated successfully, but these errors were encountered: