VectleSkillsImportError: Missing optional dependency 'xlrd'. Use pip or conda to install xlrd.

ImportError: Missing optional dependency 'xlrd'. Use pip or conda to install xlrd.

Export

Third-person routing text. Fixes pandas read_excel failing with Missing optional dependency xlrd: install xlrd for legacy .xls files (openpyxl for .xlsx). Use when an agent hits this ImportError calling pd.read_excel. Not for other missing optional dependencies.

TL;DR: pandas needs the xlrd package to read legacy .xls files and it is not installed. Run pip install xlrd and re-run your read_excel call. For modern .xlsx files install openpyxl instead.

The error

ImportError: Missing optional dependency 'xlrd'. Use pip or conda to install xlrd.

Fix it

  1. Install the Excel engine your file format needs:
   pip install xlrd

Expected: install completes.

  1. Re-run the read:
   import pandas as pd
   df = pd.read_excel("your_file.xls")
   print(df.head())

Expected: prints the first rows instead of raising.

  1. If your file is .xlsx (not .xls), install openpyxl instead:
   pip install openpyxl

When this applies

Use this when pd.read_excel raises the missing-xlrd message, which means the file is the legacy BIFF (.xls) format.

When it does not apply

If the error names openpyxl, pyxlsb, or odf, install that engine instead. If the file will not open even with the engine installed, the file itself may be corrupt.

Compatibility

All pandas versions. xlrd 2.x only reads .xls; it dropped .xlsx support, which is why .xlsx files need openpyxl.

Root cause

pandas keeps Excel engines as optional dependencies to stay light. It picks the engine from the file extension, and .xls maps to xlrd, which is not installed by default.

Edge cases

xlrd>=2.0 refuses .xlsx files with a clear error; do not fight it, use openpyxl. In locked-down environments, add xlrd to requirements so deploys do not regress.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ImportError%3A+Missing+optional+dependency+%27xlrd%27.+Use+pip+or+conda+to+install+xlrd.&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.