gsheets-connection icon indicating copy to clipboard operation
gsheets-connection copied to clipboard

SSL: CERTIFICATE_VERIFY_FAILED -> To avoid this error

Open testwebsites2023 opened this issue 1 year ago • 0 comments

To avoid the below error, raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1002)>

Use the updated code as shown below,

import ssl import streamlit as st from streamlit_gsheets import GSheetsConnection ssl._create_default_https_context = ssl._create_unverified_context # Disable SSL certificate verification url = "https://docs.google.com/spreadsheets/d/1JDy9md2VZPz4JbYtRPJLs81_3jUK47nx6GYQjgU8qNY/edit?usp=sharing" conn = st.experimental_connection("gsheets", type=GSheetsConnection) data = conn.read(spreadsheet=url, usecols=[0, 1]) st.dataframe(data)

testwebsites2023 avatar Nov 05 '23 13:11 testwebsites2023