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

Hi all!

Can you please help me with the error mentioned above?

Also, you can see my webpage deployed in the following link:
https://usd-cop-camilodiaz.streamlit.app/

And the code in my github repository: https://github.com/cjd1011/Monedas/blob/main/CÓDIGO_WEB.py

Thank you!

Remove all the pip stuff from your code.
Add a requirements.txt file to your repo and add the required non-standard-lib dependencies:

requirements.txt

streamlit
pandas
openpyxl
altair

@Franky1 Not sure if this topic was solved already? I can still see the error in @cjd1011 app.
I also encounter the same issue with pd.read_excel. And I have put openpyxl in the requirements.txt file.

The app works perfectly fine on my local environment (without openpyxl), but doesn’t when I put the app online.

Thank you for your help!

Code is here: https://github.com/malonvll/Next_GP/blob/main/app.py
And app is here: https://nextgp.streamlit.app

Franky is right. I also encountered the same problem as you, I followed Franky’s method and reboot the app at the bottom right corner of the app, I found that it can run normally.

2 Likes