xlrd.biffh.XLRDError: Excel xlsx file; not supported. How to export the .xlsx file to a Dataframe

Viewed 95

I am getting this below error while I am trying to read a .xlsx file into Pandas Dataframe. ERROR :

xlrd.biffh.XLRDError: Excel xlsx file; not supported

the code used for reading the excel sheet into Pandas Dataframe is below:

ip_data = pd.read_excel(file_path)
print(ip_data)

can anyone suggest a possible solution to export the excel file to Dataframe.

P.S: I have already installed the required version of xlrd too. i.e >=1.0.0

1 Answers

Install openpyxl with

$ pip install openpyxl

Read it with engine='openpyxl',

ip_data = pd.read_excel(
         file_path
         engine='openpyxl',
    )

Take a look here about openpyxl's documentation

Related