Using Gsheets connection

I am new to coding so this is probably very simple but I can’t figure it out.

I Can’t Get the Gsheets Connection to work

  1. My app works locally in VSCODE in Anaconda, but gives errors when run in the cloud

  2. I am trying to deploy this to the community cloud (this is a simplified version of a private app that won’t load the gsheets connection

  3. GitHub - NathanVanWieren/Test-App-Streamlit

  4. Error Message:


You can now view your Streamlit app in your browser.

Network URL: http://172.16.5.4:8502
External URL: http://172.172.133.250:8502

2024-05-30 18:13:48.892 Uncaught app exception
Traceback (most recent call last):
File “/home/vscode/.local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 600, in _run_script
exec(code, module.dict)
File “/workspaces/Test-App-Streamlit/Streamlit_app.py”, line 4, in
from streamlit_gsheets import GSheetsConnection
ModuleNotFoundError: No module named ‘streamlit_gsheets’
^C Stopping…
@NathanVanWieren ➜ /workspaces/Test-App-Streamlit (main) $


Code:

import streamlit as st

st.write(“Test App 1”)

from streamlit_gsheets import GSheetsConnection

Create a connection object.

conn = st.connection(“gsheets”, type=GSheetsConnection)

df = conn.read()

Unfortunately I do not understand your answer. I had used the tutorial provided on gsheets and everything works in VScode. It does not work in web deployment though.

I now get a “Spreadsheet must be specified” error. I just can’t get this to work online though it works fine offline.

I have same issue, are you able to figure it out ?