0

It is a code to read data in excel

import os 
import pandas as pd #pandas library is to work with dataframes
os.chdir("C:\Education\Study Materials\Python for Data science\Data Sets")
data_xlsx=pd.read_excel("Iris_data_sample.xlsx", sheet_name="Iris_data")

Error: ImportError: Missing optional dependency 'xlrd'. Install xlrd >= 1.0.0 for Excel support Use pip or conda to install xlrd.

12345
  • 11
  • 3
  • 1
    https://stackoverflow.com/questions/48066517/python-pandas-pd-read-excel-giving-importerror-install-xlrd-0-9-0-for-excel[Link gives you the resolution](https://stackoverflow.com/questions/48066517/python-pandas-pd-read-excel-giving-importerror-install-xlrd-0-9-0-for-excel) Please go through the above link – Manjari Mar 22 '21 at 14:56

2 Answers2

0

You need to install the xlrd package, you can search xlrd PyPi and copy the package and install in your working directory Pip install

If you are using environment, activated your environmental and install the package

Once you successfully install the package import the package Example - import xlrd

0

try this one :

pip install xlrd

You can also update your pip if required 
pip install --upgrade pip
vijaydeep
  • 395
  • 3
  • 12