Short answer: pandas needs the optional `openpyxl` package to read and write .xlsx files. Install it in the same environment, then rerun. ``` ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl. ``` 1. Run `python -m pip install openpyxl` (conda users: `conda install openpyxl`). In a Jupyter notebook use `!pip install openpyxl` and then restart the kernel. Expected: install completes cleanly. 2. Verify with `python -c "import openpyxl; print(openpyxl.__version__)"`. Expected: a version number prints. 3. Rerun `pd.read_excel("file.xlsx")`. Expected: a DataFrame, no ImportError. 4. If the error persists, you installed into a different interpreter. Check `python -c "import sys; print(sys.executable)"` and reinstall using that Python's `-m pip`. Root cause: pandas treats Excel engines as optional to keep the base install small. The error message names the missing engine, so there is nothing to diagnose beyond installing it. When to use: reading or writing .xlsx files with pandas. When NOT to use: legacy .xls files need `xlrd`, and .ods files need `odfpy`, openpyxl will not help there. Variant phrasings: "importerror missing optional dependency openpyxl", "pandas read_excel openpyxl", "use pip or conda to install openpyxl". Edge cases: on managed platforms that block pip installs (some notebook hosts, workflow tools) you cannot install it yourself, check the platform's package policy instead.

Context: pandas deliberately keeps Excel support out of its base install and loads it as an optional dependency. When you call `pd.read_excel` on an .xlsx file without openpyxl installed, pandas raises this ImportError and tells you exactly what to install. The fix is one install command in the right environment.