I’m having trouble deploying a Streamlit app to Streamlit Community Cloud. The app runs correctly on my local machine but fails during Cloud deployment.
Problem description
-
The app runs successfully on localhost using Python 3.12.6.
-
On Streamlit Cloud, deployment gets stuck or fails during dependency installation.
-
Errors I’ve seen include:
The logs show:
Using Python 3.13.11 environment at /home/adminuser/venv
ERROR: Failed building wheel for pandas
Environment details
1. Local Python: 3.12.6 (Windows)
2. Streamlit Cloud Python: defaults to 3.13.x
3. Streamlit version: latest (via pip)
4. OS (local): Windows 10/11
5. Deployment: Streamlit Community Cloud (GitHub repo
What I have tried:
1. Creating a brand new GitHub repository
2. Simplifying the app
3. Updating requirements.txt
4. Adding / removing runtime.txt
5. Rebooting the app on Streamlit Cloud
6. Redeploying multiple times
The app still works locally but fails on Cloud.
Links
App: https://app-data-app2-b7fxvsfgsjy5bttdtwsi8m.streamlit.app
GitHub repo: https://github.com/kyykawa/streamlit-data-app2
Hey, thanks for sharing all those details and welcome to the Streamlit community!
This is a super common issue when deploying to Streamlit Community Cloud, especially with dependency installation and Python version mismatches.
Here’s what’s happening: Streamlit Community Cloud currently defaults to Python 3.13.x, but not all packages (like pandas and plotly) have stable wheels for 3.13 yet. This leads to errors like Failed building wheel for pandas and ModuleNotFoundError for plotly.express. Also, runtime.txt is not supported for setting the Python version on Community Cloud; you must select the Python version in the app’s Advanced settings during deployment or from the app dashboard. Make sure your requirements.txt includes all needed packages (e.g., plotly, pandas) and that you’re not including built-in modules or misspelled package names. For more, see the official docs on app dependencies and Python version selection.
To resolve this:
- Go to your app’s settings on Streamlit Community Cloud and set the Python version to 3.12 (or 3.11 if your dependencies require it).
- Double-check your requirements.txt to ensure it lists all external dependencies (e.g., plotly, pandas) and does not include built-in modules.
- Reboot your app after making these changes.
If you’re still stuck, please share your requirements.txt and any error logs from the Cloud logs panel. The community is always happy to help debug! For more troubleshooting tips, check out the ModuleNotFoundError guide and dependency management best practices.
Sources:
Thank you so much for the clear explanation and detailed guidance!
You were absolutely right — the issue was the Python version mismatch. After changing the Python version to 3.12 in the Streamlit Community Cloud settings and cleaning up my requirements.txt, the app deployed successfully and is now working as expected.
I also didn’t realize that runtime.txt isn’t supported on Community Cloud, so that clarification really helped.
Thanks again for the help and for pointing me to the relevant documentation — much appreciated!