Worksheet.set_dataframe throws error AttributeError: 'NoneType' object has no attribute 'MultiIndex'
# write pandas df to google sheets
import pandas as pd
import pygsheets as pgs
c = pgs.authorize(...)
s = c.open_by_key(spreadsheet_id)
w = s.sheet1
df = pd.DataFrame({"id":[1,2,3],"val":["A","B","C"]})
print(df.columns)
print(isinstance(df.columns, pd.MultiIndex))
! w.set_dataframe(df=df, start="A8")
>>
Index(['id', 'val'], dtype='object')
False
! ----
- **AttributeError**: 'NoneType' object has no attribute 'MultiIndex'

nah, after reauthorizing it's works fine. There problem with expired session. While working with pygsheets via jupyter I haven't seen any warning messages about expiration
What do you mean by reauthorizing?
What do you mean by reauthorizing? I mean this
s = c.open_by_key(spreadsheet_id)s is session I split code in jupyter in two blocks. First block initializes session. Second block manipulates with data. So I run just once init block, init session and then worked only with second block. When session is died pygsheets gives me error of this topic. It confused me first time
I am facing the Same Issue, One Jupiter file code runs without any error then other facing issues but sometimes shows this error in all files, randomly start showing that function as part of the lib and working well, bit confusing