I am trying to connect streamlit app to the google sheets as guided by the streamlit community. after running the following part of the code:
scope=[āhttps://www.googleapis.com/auth/driveā,
āhttps://www.googleapis.com/auth/spreadsheetsā]
credentials = service_account.Credentials.from_service_account_info(
st.secrets[āgcp_service_accountā],
scopes=scope,
)
I face the following error.
2022-08-22 16:03:54.453 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\s.kian\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 556, in _run_script
exec(code, module.__dict__)
File "C:\Users\s.kian\OneDrive - Intrum Law\Desktop\tt\gsh.py", line 11, in <module>
credentials = service_account.Credentials.from_service_account_info(
File "C:\Users\s.kian\AppData\Local\Programs\Python\Python310\lib\site-packages\google\oauth2\service_account.py", line 221, in from_service_account_info
signer = _service_account_info.from_dict(
File "C:\Users\s.kian\AppData\Local\Programs\Python\Python310\lib\site-packages\google\auth\_service_account_info.py", line 58, in from_dict
signer = crypt.RSASigner.from_service_account_info(data)
File "C:\Users\s.kian\AppData\Local\Programs\Python\Python310\lib\site-packages\google\auth\crypt\base.py", line 113, in from_service_account_info
return cls.from_string(
File "C:\Users\s.kian\AppData\Local\Programs\Python\Python310\lib\site-packages\google\auth\crypt\_python_rsa.py", line 154, in from_string
marker_id, key_bytes = pem.readPemBlocksFromFile(
File "C:\Users\s.kian\AppData\Local\Programs\Python\Python310\lib\site-packages\pyasn1_modules\pem.py", line 44, in readPemBlocksFromFile
substrate = ''.encode().join([base64.b64decode(x.encode()) for x in certLines])
File "C:\Users\s.kian\AppData\Local\Programs\Python\Python310\lib\site-packages\pyasn1_modules\pem.py", line 44, in <listcomp>
substrate = ''.encode().join([base64.b64decode(x.encode()) for x in certLines])
File "C:\Users\s.kian\AppData\Local\Programs\Python\Python310\lib\base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
I searched a lot in the internet, not found anything. I am in urgent need of your kind responses.
Thanks