Cannot find Google Cloud keys

Hello! I’m dveloping my first streamlit dashboard.
I’ve tried to run it locally, but a problem occurs.
The secrets.toml file is correctly uploaded into the CWD/.streamlit folder and has the following form:

spreadsheet = ""

type = "service_account"

This is a sample code:

import streamlit as st
from gspread_pandas import Spread, Client
from google.oauth2 import service_account
import pandas as pd

scope = ['', '']

# Load secrets
secrets = st.secrets["gsheets"]


credentials = service_account.Credentials.from_service_account_info(

client = Client(scope=scope, creds=credentials)
spreadsheetname = "weight"

spread = Spread(spreadsheetname, client=client)

# Check the connection

sh =
worksheet_list = sh.worksheets()

# Functions
# Get our worksheet names
def worksheet_names():
    sheet_names = []
    for sheet in worksheet_list:
    return sheet_names

# Get the sheet as dataframe
def load_the_spreadsheet(name):
    worksheet = sh.worksheet(name)
    df = pd.DataFrame(worksheet.get_all_records())
    return df

dataframe = load_the_spreadsheet(spreadsheetname)

And the error in the browser is:

SpreadsheetNotFound: Spreadsheet not found

I’ve also noticed that when printing secrets the shell returns a dict and a “Couldn’t retrieve email. Delete credentials and authenticate again”