Error loading xyz.xlsx: Import openpyxl failed. Use pip or conda to install the openpyxl package

Welcome to the Streamlit community, and thanks for sharing your question and error details! :tada: This is a common issue when deploying apps that read Excel files on Streamlit Community Cloud. The error “Import openpyxl failed. Use pip or conda to install the openpyxl package.” means the openpyxl library isn’t available in your deployment environment, even though you’ve listed it in requirements.txt.

To resolve this, make sure your requirements.txt file is named exactly requirements.txt (all lowercase), is in the root of your GitHub repo, and contains all the dependencies you use (which you’ve done). After updating or confirming this, commit and push your changes to GitHub, then reboot your app on Streamlit Cloud. If you still see the error, double-check for typos in the filename or package names, and ensure there are no conflicting dependency files (like environment.yml). For more troubleshooting tips, see the official docs and community solutions: App dependencies for your Community Cloud app, ModuleNotFoundError No module named - Streamlit Docs, and Forum example.

If you’re still stuck, please share a minimum reproducible example or your repo link so the community can help debug further. Folks, feel free to jump in with your insights or similar experiences!

Sources: