A Very Important Note from here: gspread docs
Very important! Go to your spreadsheet and share it with a client_email from the step above. Just like you do with any other Google account.
If you don’t do this, you’ll get a gspread.exceptions.SpreadsheetNotFound exception when trying to access this spreadsheet from your application or a script.
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:
{
"type": "service_account",
"project_id": "speeqedy-octane-317516",
"private_key_id": "8ct0ad00e3e59d49a576012cb515ea89e4e49cc4",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCOlC07MwSYGr54\nMx1+XAXC2k8HrBA/W6I3PZxnG5CUTPL8rJy8Ne2kuXW2k3qN/A0CKf2yUKc0DbIP\nn+LsCDYt6ikTOpb5VeToRMFPlg3dwcghsVFlO2RKVZc1NiWYDiUu5jqjy/WOpqNH\nMZbPDJchhApiyEb+brSpgag0Smpn8oWNBFNUqyN7n+dQMDxlwe9CniM6p19rhwyX\nPPwYcONb/FQffIRrjUlSbxAV+uTwoN/BeTN/jDvjDSdbF2jfBzis/sBejZAt3wsA\nzM2KcNu/bGFck+Slg0rXbHf8qPW4C+kuGe4x5KI4y/SG77TuuflNfeIIadwVblAH\nruhlzGRvAgMBAAECggEAQ7+rIncilrgWi30WZaWKY0Viyi17Zu++y+rtt5zEfYN2\n7pOCwngJnP03LvMzB+ads8qKL0HdwYFEe+IobKmWPQkITYfIl1+2LpwFEzElE5tx\n4nikSasIA75Z5EH/aRpHltp1QMG4w/jwmvK4S1gbNCTO3pN2EI5AME9YwsgdeZhx\nFPbTlZ7CstqrvJwrejInuX7b7+YLCRUiLz09n5xDVLCpgzqcUxRUIlX6qnQ5O5fQ\nUmVI4qeeIMb3TE2X6JN2Hon5RCqA1j6kNj3auIgDgrqCarcjX4MU9hDlBfj+MRKM\nZz19lNCYBL7D2p9o+QJMzBakmUawdEdm0PNnzouxGQKBgQDIHE6H3u84YzqWsyAm\nJoON9jWq3Z0Dp9Woxd1c12sJGaqpCjvejAHsUklRDLSnj/9TxySxCBtHzOkpWZ27\nC1+ZQVkHgVkJaBRJ2dxwsNODDyvn12gN2OE00e0IATx6hIuMrZBiisrOldlzkfbe\nbrzdpcverz/j8O+DU+xlpkd+bQKBgQC2ZmkO+P2fofc4AbnLNKqr8e9NVqMAHovi\nj6dqE1/YQwarXyORHlpqZy0cqG1yXHiTXdQCkRf2oaLtUMoNARywCNNsJcmTUccm\nbG1/g3KdcsTu5r7/IgJjJ6Oytd5WE3nOOG0pN0PxTVjhC5GIMdDqT7bO7PxYxt8J\ny5stQwE0ywKBgEjUZJB2xsHS+4PVdaHs6nxEW4vwVDD8aHqgaMxdaotJWB9lphx9\nAEYuPJjO8wD5G4g2NlhoBuW+4i02fH2SyhxQ+EIPBYSy6I9oRx6MfK56WxRqBWjk\nwjIjJQ2Axa4hh1iP4ri6os1FJHs3aI3T59ETgnttdOdUzRcS+DqWpfaRAoGADnjx\nvQ5kkVX4l6kLZOQ45ou7wRcut8O0tbVQQ0pmQHKRBOf3mnweEHM/URbMGFbd+lNn\njwyUKi2JD+tpHL8J163bmKkm5VmHw7S2u3dikLuahJoqbXP1XIi4pGVpzsqcz5AK\nmUqZSXwpoTGZyoSpXu4UQzbqjuC4sb5GAcFfRyECgYEAqPEqRTfjU48q8X5ZNx/D\nGze5ZU8PpkOr9viffcptt7dF9f/SMyqY6a8oDzm70tN8IHsctoadu/9ZqUAC56XO\nZtc96uppNBHM/ZZr2eXR6iU8fXTkHgA009xYeOIciS/exvlntTn7qeBiLb5DyA2s\nHB/iyGpo6KQBl/rRtcNxQXw=\n-----END PRIVATE KEY-----\n",
"client_email": "[email protected]",
"client_id": "102481923285078876543",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/cybor%40speedy-octane-317516.iam.gserviceaccount.com"
}
if this is your JSON file then you need to copy the client_email that is
[email protected]
and then share your sheets to this email id.