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

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

Export

Fixes ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl. Use when pd.read_excel / ExcelFile / to_excel on .xlsx raises Missing optional dependency 'openpyxl' Not for: the file itself is missing (FileNotFoundError) or corrupt (BadZipFile)

How to fix ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.

Install the Excel engine: python -m pip install openpyxl. pandas deliberately does not bundle Excel readers; read_excel on an .xlsx file needs openpyxl installed in the same environment. Use the exact same python/pip pair (python -m pip) so it lands in the right env.

The exact error

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

Fix it

  1. Run python -m pip install openpyxl.

Expected: pip reports Successfully installed openpyxl

  1. Retry pd.read_excel('file.xlsx').

Expected: returns a DataFrame, no ImportError

  1. For legacy .xls files you need xlrd instead: python -m pip install xlrd.

Expected: read_excel works on .xls

When this applies

pd.readexcel / ExcelFile / toexcel on .xlsx raises Missing optional dependency 'openpyxl'

When this does NOT apply

the file itself is missing (FileNotFoundError) or corrupt (BadZipFile)

Versions

pandas >= 1.0 reading .xlsx

Why it happens

Excel IO engines are optional dependencies; pandas raises a helpful ImportError telling you which one to install.

Edge cases

xlrd >= 2.0 dropped .xlsx support, so do not 'fix' this by installing xlrd for an .xlsx file.

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+%27openpyxl%27.+Use+pip+or+conda+to+install+openpyxl.&type=skill'

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