Hey there, thanks for sharing your issue and welcome to the Streamlit community!
This is a common pain point lately. Streamlit Community Cloud does NOT respect runtime.txt or .python-version files for Python version selection. The only supported way to set the Python version is via the “Advanced settings” dialog during deployment or from your app’s settings in the dashboard. However, there have been recent reports that, despite selecting Python 3.11 in Advanced settings, the build environment still uses Python 3.14.x—this appears to be a platform-side bug or a lag in the rollout of new Python versions.
There’s currently no user-side workaround to force Python 3.11 if the platform is defaulting to 3.14 regardless of your settings. The best practice is to delete and redeploy your app, making sure to select Python 3.11 in Advanced settings. If the issue persists, it’s likely a bug or temporary limitation on Streamlit Cloud’s end. For more details, see the official docs and related forum threads: Upgrade Python, Python version selection, and runtime.txt ignored.
Sources: