pmaengineering / ppp

The Pretty PDF Printer--Converting ODK XlsForm Excel files into "paper questionnaires".
http://ppp.pma2020.org
MIT License
11 stars 6 forks source link

odk-ppp cannot convert XLSX format #61

Open monitoringhsd opened 1 year ago

monitoringhsd commented 1 year ago

Description

The odk-ppp cannot convert XLSX into DOC, only XLS is accepted. Attempted on MacOS Ventura 13 (M1) and Ubuntu ARM64 22.04.

Steps to Reproduce

  1. download demo.xlsx file from ppp github
  2. cd to the directory with demo.xlsx
  3. run in Terminal: python3 -m ppp demo.xlsx -l English -f doc -t old -p standard > myXlsForm.doc

Desired/expected behavior

The demo.doc should be created.

Actual behavior

There is an error in Terminal and demo.doc is not created: File "/Users/serge/Library/Python/3.9/lib/python/site-packages/xlrd/__init__.py", line 170, in open_workbook raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported') xlrd.biffh.XLRDError: Excel xlsx file; not supported

jkpr commented 1 year ago

Uninstall xlrd and install it this way

pip install xlrd==1.2.0

Sent from my Pixel 4. Forgive teh typos.

On Thu, Feb 9, 2023, 4:54 AM Serge Bychkov @.***> wrote:

Description

The odk-ppp cannot convert XLSX into DOC, only XLS is accepted. Attempted on MacOS Ventura 13 (M1) and Ubuntu ARM64 22.04. Steps to Reproduce

  1. download demo.xlsx file from ppp github
  2. cd to the directory with demo.xlsx
  3. run in Terminal: python3 -m ppp demo.xlsx -l English -f doc -t old -p standard > myXlsForm.doc

Desired/expected behavior

The demo.doc should be created. Actual behavior

There is an error in Terminal and demo.doc is not created: File "/Users/serge/Library/Python/3.9/lib/python/site-packages/xlrd/init.py", line 170, in open_workbook raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported') xlrd.biffh.XLRDError: Excel xlsx file; not supported

— Reply to this email directly, view it on GitHub https://github.com/pmaengineering/ppp/issues/61, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6N3VUICPBPYFZEDKTA2F3WWTEHNANCNFSM6AAAAAAUWMRVV4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

monitoringhsd commented 1 year ago

Thanks for the hint. Very much appreciated!

Note for anyone else that comes across this, apparently xlrd dropped support for anything other than xls since v.2.0.0, which kinda sucks. Would have to create a venv just for this to be able to use in the future. https://xlrd.readthedocs.io/en/latest/ https://xlrd.readthedocs.io/en/latest/changes.html