# Cannot find Google Cloud keys

**URL:** <https://discuss.streamlit.io/t/cannot-find-google-cloud-keys/65428>\
**Category:** Using Streamlit\
**Tags:** streamlit-cloud, discussion\
**Created:** [March 24, 2024, 7:21pm UTC](https://discuss.streamlit.io/t/cannot-find-google-cloud-keys/65428 "2024-03-24T19:21:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincenzojrs](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/vincenzojrs/32/73906_2.png) [@vincenzojrs](https://discuss.streamlit.io/u/vincenzojrs)\
**Post date:** [March 24, 2024, 7:21pm UTC](https://discuss.streamlit.io/t/cannot-find-google-cloud-keys/65428/1 "2024-03-24T19:21:12Z")

</div>

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:

```auto
[gsheets]
spreadsheet = ""

[gsheets.credentials]
type = "service_account"
...

```

This is a sample code:

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

scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']

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

print(secrets)

credentials = service_account.Credentials.from_service_account_info(
    secrets["credentials"],
    scopes=scope
)

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

spread = Spread(spreadsheetname, client=client)

# Check the connection
st.write(spread.url)

sh = client.open(spreadsheetname)
worksheet_list = sh.worksheets()

# Functions
@st.cache()
# Get our worksheet names
def worksheet_names():
    sheet_names = []
    for sheet in worksheet_list:
        sheet_names.append(sheet.title)
    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)
st.dataframe(dataframe)

```

And the error in the browser is:

```auto
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”_

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [September 20, 2024, 7:22pm UTC](https://discuss.streamlit.io/t/cannot-find-google-cloud-keys/65428/2 "2024-09-20T19:22:11Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
