If you encounter the error
ModuleNotFoundError: No module named ‘altair.vegalite.v4’ in Streamlit Spaces,
do one of the following to fix it:
- Set the
As reported in this Streamlit forum post, this error started appearing few days ago.
This bug occurs when using Streamlit 1.19.0 or earlier with Altair v5, and it became apparent with a recent release of Alteir v5.
In Hugging Face Spaces, the default Streamlit version is
1.19.0. So creating a new Streamlit Space or rebuilding an existing one will result in this error.
To fix it, you can either add
requirements.txt or set the
1.22.0 is not yet available on HF Spaces).