I am able to import openpyxl but when I try to run a sample script I get an error which I could use some help understanding.
from openpyxl import Workbook
wb = Workbook()
ws = wb.active
ws['A1'] = 42
ws.append([1, 2, 3])
ws['A2'] = datetime.datetime.now()
at the last line wb.save, I get an error in openpyxl/writer/worksheet.py, line 192, in write_worksheet to the effect
with xmlfile(out) as xf:
TypeError: 'module' object is not callable.
Any help is much appreciated.
Line 192 of https://bitbucket.org/openpyxl/openpyxl/src/59d472f008dbbe2f99c487879709204115090e93/openpyxl/writer/worksheet.py is the issue. It thinks that xmlfile is a function when it is a module.
Line 20 of worksheet.py imports xmlfile from https://bitbucket.org/openpyxl/openpyxl/src/59d472f008dbbe2f99c487879709204115090e93/openpyxl/xml/functions.py
Line 16 of functions.py is looking to see if the lxml module is present. Lxml is NOT present in Pythonista so line 51 imports xmlfile from et_xmlfile.
At this point I could not find et_xmlfile. ET phone home.
Thank you. I found et_xmlfile, and added it to the library and now this simple script works.