I have had recently issues using pyxform (1.5.1) to convert XLSX Forms to XML.
The error message:
Traceback (most recent call last):
File "/usr/local/bin/xls2xform", line 8, in
File "/usr/local/lib/python3.9/site-packages/pyxform/xls2xform.py", line 172, in main_cli
warnings = xls2xform_convert(
File "/usr/local/lib/python3.9/site-packages/pyxform/xls2xform.py", line 38, in xls2xform_convert
json_survey = xls2json.parse_file_to_json(xlsform_path, warnings=warnings)
File "/usr/local/lib/python3.9/site-packages/pyxform/xls2json.py", line 1414, in parse_file_to_json
workbook_dict = parse_file_to_workbook_dict(path, file_object)
File "/usr/local/lib/python3.9/site-packages/pyxform/xls2json.py", line 1388, in parse_file_to_workbook_dict
return xls_to_dict(file_object if file_object is not None else path)
File "/usr/local/lib/python3.9/site-packages/pyxform/xls2json_backends.py", line 50, in xls_to_dict
workbook = xlrd.open_workbook(filename=path_or_file)
File "/usr/local/lib/python3.9/site-packages/xlrd/init.py", line 130, in open_workbook
bk = xlsx.open_workbook_2007_xml(
File "/usr/local/lib/python3.9/site-packages/xlrd/xlsx.py", line 812, in open_workbook_2007_xml
File "/usr/local/lib/python3.9/site-packages/xlrd/xlsx.py", line 266, in process_stream
for elem in self.tree.iter() if Element_has_iter else self.tree.getiterator():
AttributeError: 'ElementTree' object has no attribute 'getiterator'
shows that the issue appears when reading the excel file, due a change in pandas. I can solve the issue in other scripts using the engine openpyxl, as suggested in this post.
I guess using a virtual environment would be a solution. Nevertheless, is there any update planned in pyxform to handle this problem in general? Is this a known issue?
Thanks a lot!