PydPiper / pylightxl

A light weight, zero dependency, minimal functionality excel read/writer python library
https://pylightxl.readthedocs.io
MIT License
300 stars 47 forks source link

Can not read xlsx file #24

Closed machearn closed 3 years ago

machearn commented 3 years ago

Pylightxl Version: 1.47 Python Version: 3.8.5

Summary of Bug/Feature: When I try to use readxl() to load my excel file, it raised ValueError exception.

Traceback:

 File "/home/pengtao/code/excel2json/excel2json.py", line 29, in <module>
    licenses_sheet = xl.readxl(fn='opendataset.xlsx').ws('License')
  File "/home/pengtao/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pylightxl/pylightxl.py", line 91, in readxl
    sh_names, namedranges = readxl_get_workbook(f, f_zip)
  File "/home/pengtao/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pylightxl/pylightxl.py", line 177, in readxl_get_workbook
    ET.register_namespace(prefix, uri)
  File "/home/pengtao/.pyenv/versions/3.8.5/lib/python3.8/xml/etree/ElementTree.py", line 1031, in register_namespace
    raise ValueError("Prefix format reserved for internal use")
ValueError: Prefix format reserved for internal use

Suggestion for fix: None

PydPiper commented 3 years ago

Hi there,

Thank you for considering pylightxl. Sorry you ran into an issue we are taking a look now.

Was the spreadsheet created by another python library? Like openpyxl or xlrd? Can you provide the excel file in question?

machearn commented 3 years ago

Sorry, I can not provide the excel file, because it contains secret infomation of my company

PydPiper commented 3 years ago

new pylightxl version 1.48 addresses excel file read/write that were created by openpyxl that caused an issue for pylightxl to read/write excel files. Please take a look at the new version and open a new issue if the problem still exists.