+1 vote
in Programming Languages by (66.8k points)

While reading an excel file using pandas read_excel() function, I got the following error:

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

How to fix this error?

1 Answer

+2 votes
by (51.8k points)
selected by
Best answer

As the error message suggests, please run the "pip install openpyxl" command on the terminal. It will install openpyxl if it's not already installed on your system.

If it does not work, it may be possible that you already have openpyxl installed and you need to upgrade it. In that case, please run the following command on the terminal to upgrade it.

pip install openpyxl --upgrade