I am new to both python programming and the raspberry pi environment and I need to do some project with it. As I was trying to run the sample code for the openpyxl library I found myself stuck in the error provided in the title, Attribute Error: 'Workbook' object has no attribute 'active' I tried to install some more packages to check if there are just missing libraries but none of them work
the code I am trying is below:
from openpyxl import Workbook
wb = Workbook()
ws = wb.active
ws['A1'] = 42
ws.append([1, 2, 3])
import datetime
ws['A2'] = datetime.datetime.now()
wb.save("sample.xlsx")
how can I get to run it? thanks in advance