[Python] Getting 'KeyError: "There is no item named 'xl/sharedStrings.xml' in the archive"'...

Discussão em 'Python' iniciado por Stack, Março 17, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to import data into PowerBi using a Python script so that I can schedule it to refresh data at regular basis. I am facing a challenge getting the data from an excel file and receiving the error 'KeyError: "There is no item named 'xl/sharedStrings.xml' in the archive" ' while importing.

    When I look into the archive of the xlsx file in the xl folder there is no file sharedString.xml. As there are no strings in the excel. the file opens properly in an excel without any issues but not with python.

    import openpyxl
    import pandas
    import xlrd
    import os
    globaltrackerdf = pandas.read_excel (r'C:\Users\Documents\Trackers\Tracker-Global Tracker_V2-2022-06-13.xlsx',sheet_name="Sheet1",engine="openpyxl")

    Continue reading...

Compartilhe esta Página