ImportError: Missing optional dependency 'xlrd'. Install xlrd >= 2.0.1 for xls Excel…
- User
ImportError: Missing optional dependency 'xlrd'. Install xlrd >= 2.0.1 for xls Excel support Use pip or conda to install xlrd.
- Assistant
The error message you're seeing indicates that your Python code is trying to read an Excel file in the
.xlsformat, but it cannot find thexlrdlibrary, which is required for this task. As of version 2.0.1,xlrdno longer supports.xlsxfiles, so if you are specifically trying to read.xlsfiles, you'll need to install it.Here's how you can resolve this issue:
Step 1: Install
xlrdYou can install the
xlrdpackage using eitherpiporconda.Using pip:
Open your terminal or command prompt and run:
bashpip install xlrd==2.0.1Using conda:
If you are using Anaconda, you can install with: