Python pandas.read_excel error: "No module named xlrd"

pandas
python

#1

Hi,

I’m using Enthought Canopy and Pandas came installed by default on this environment.

However, when I’m using the Pandas default command:
pd.read_excel("excelfile.xlsx",sheetname="sheet1")

I’m getting an error:
ImportError: No module named xlrd

Any help would be really appreciated.

Thanks,
Aarshay


#2

@Aarshay,

Please check the case of sheet name, it might be cause of error.

Regards,
Sunil


#3

@Sunil

Thanks Sunil!

I got the wrong sheet name error as well. But the error mentioned above was due to the package “xlrd” not being installed.

Basically, pandas has 3 types of package dependencies:

  1. Fixed: installed by default
  2. Recommended: help in speeding up processes
  3. Optional: these have to be downloaded separately (xlrd is one of them)
    More on : http://pandas.pydata.org/pandas-docs/stable/install.html

I suppose xlrd doesn’t come by default on Enthought Canopy so had to download it again on Canopy command prompt using:
enpkg xlrd

Cheers,
Aarshay


#4

Thanks Aarshay. It helped me