1

I am trying to read an excel file with multiple sheets using llama-index. Here is my code:

from pathlib import Path
from llama_index import download_loader

PandasExcelReader = download_loader("PandasExcelReader")

loader = PandasExcelReader()
documents = loader.load_data(file=Path('dir1/excel.xlsx'),sheet_name=none)

When I run it, I get File "PycharmProjects/venv/lib/python3.11/site-packages/llama_index/readers/llamahub_modules/file/pandas_excel/base.py", line 64, in load_data if self._concat_rows: ^^^^^^^^^^^^^^^^^ AttributeError: 'PandasExcelReader' object has no attribute '_concat_rows'

My llama-index version is 0.6.0

user2966197
  • 2,793
  • 10
  • 45
  • 77

1 Answers1

1

The issue is related to the version of illama_index cause the '_concat_rows' attribute was removed in version 0.6.0. Thats why you are getting 'AttributeError'.

You can either downgrade to a previous verison or you can just modify your code with the new version.

To modify your code you have to replace the 'sheet_name=none' with the 'sheet_index=None'.

It should look like this:

from pathlib import Path
from llama_index import download_loader

PandasExcelReader = download_loader("PandasExcelReader")

loader = PandasExcelReader()
documents = loader.load_data(file=Path('dir1/excel.xlsx'), sheet_index=None)
Chewbacca
  • 139
  • 6