Skip to content
Advertisement

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

I used pandas to read excel file and then received an ImportError shown below.

code:

pressure_2018=pd.read_excel('2018_pressures.xlsx')

Error:

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

Then I installed xlrd on my computer using code shown below:

pip install xlrd

But I still received the same issue. In output, it always returned this ImportError. It made me feel confused and frustrated, because I have installed xlrd on my computer. Could you please give me some ideas about how to resolve this error.

Advertisement

Answer

You can install openpyxl using pip install openpyxl and then try:

pd.read_excel('2018_pressures.xlsx', engine='openpyxl')

This is an alternative solution but it will work.

Advertisement