Hi there, I got an error when running the app. I ran the app locally. The terminal shows an error like this
2024-07-19 14:29:23.026 Uncaught app exception
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in _run_script
exec(code, module.__dict__)
File "/Users/username/Desktop/streamlit_data_input/streamlit_app.py", line 2, in <module>
from streamlit_gsheets import GSheetsConnection
ModuleNotFoundError: No module named 'streamlit_gsheets'
2024-07-19 14:29:24.642 Uncaught app exception
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in _run_script
exec(code, module.__dict__)
File "/Users/username/Desktop/streamlit_data_input/streamlit_app.py", line 2, in <module>
from streamlit_gsheets import GSheetsConnection
ModuleNotFoundError: No module named 'streamlit_gsheets'
2024-07-19 14:29:25.659 Uncaught app exception
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in _run_script
exec(code, module.__dict__)
File "/Users/username/Desktop/streamlit_data_input/streamlit_app.py", line 2, in <module>
from streamlit_gsheets import GSheetsConnection
ModuleNotFoundError: No module named 'streamlit_gsheets'
2024-07-19 14:29:27.665 Uncaught app exception
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in _run_script
exec(code, module.__dict__)
File "/Users/username/Desktop/streamlit_data_input/streamlit_app.py", line 2, in <module>
from streamlit_gsheets import GSheetsConnection
ModuleNotFoundError: No module named 'streamlit_gsheets'
after checking the installed module on my venv, it shown that the st-gsheets-connection is already installed (st-gsheets-connection==0.0.4)
python and streamlit version on my machine as follows
streamlit==1.36.0
Python 3.10.6
my code as follows
import streamlit as st
from streamlit_gsheets import GSheetsConnection
import pandas as pd
#Display title and description
st.title("Vendor Management Portal")
st.markdown("Enter the details of the new vendor below")
#establishing a google sheets connection
conn = st.experimental_connection("gsheets", type=GSheetsConnection)
# Fetch existing data
existing_data = conn.read(worksheet="Vendors", usecols=list(range(6)), ttl=5)
existing_data = existing_data.dropna(how="all")
st.dataframe(existing_data)