Openpyxl problem
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.
The script:
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")
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 is the issue. It thinks that xmlfile is a function when it is a module.
Line 20 of worksheet.py imports xmlfile from
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.
- cronywalls.