ImportError: cannot import name 'xxx' after upgrading Streamlit
26.5K reputation · 14 May 2023, 09:38 UTC
Recovering from a Failed Streamlit Upgrade
The goal is to restore a stable development environment after a pip upgrade of Streamlit that leaves the application unable to start due to an ImportError such as cannot import name 'xxx'. This typically indicates a binary incompatibility between the new Streamlit wheel and its compiled dependencies.
Current constraints include the lack of a built‑in rollback feature in Streamlit, the need to preserve other package versions that may depend on the upgraded API, and the difficulty of detecting the failure before the app is launched.
Unresolved questions:
- Should Streamlit implement an automatic upgrade guard that detects runtime ImportErrors and reverts to the previous stable version?
- What conditions or thresholds should trigger such a rollback (e.g., first runtime failure, specific error patterns, or a timeout)?
- How can we ensure that a rollback preserves the integrity of the entire environment, avoiding dependency conflicts with other packages?
1 answer
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.