Streamlit Spaces broken by altair requirement problem
Streamlit older spaces I have been compiling lately are all returning this new error about altair conflict, possibly related to 3.8 python distrib changes - can you fix this dependency issue in the docker distrib image?huggingface.coMediaPipe-Realtime-AI - a Hugging Face Space by awacke1Discover amazing ML apps made by the community===== Build Queued at 2023-05-19 11:33:53 / Commit SHA: 2e237c0 =====→ FROMDockerDONE 0.0s→ RUN sed -i ‘shttp://deb.debian.orghttp://cdn-aws.deb.debian.orgg’ /etc/apt/sources.list && sed -i ‘shttp://archive.ubuntu.comhttp://us-east-1.ec2.archive.ubuntu.comg’ /etc/apt/sources.list && sed -i ‘/security/d’ /etc/apt/sources.list && apt-get update && apt-get install -y 	git 	git-lfs 	ffmpeg 	libsm6 	libxext6 	cmake 	libgl1-mesa-glx 	&& rm -rf /var/lib/apt/lists/* 	&& git lfs installCACHED→ RUN --mount=target=pre-requirements.txt,source=pre-requirements.txt 	pip install --no-cache-dir -r pre-requirements.txtCACHED→ RUN useradd -m -u 1000 userCACHED→ RUN --mount=target=requirements.txt,source=requirements.txt 	pip install --no-cache-dir -r requirements.txtCACHED→ RUN pip install --no-cache-dir pip==22.3.1 &&     pip install --no-cache-dir         datasets         “huggingface-hub>=0.12.1” “protobuf<4” “click<8.1”CACHED→ RUN --mount=target=/root/packages.txt,source=packages.txt 	sed -i ‘shttp://deb.debian.orghttp://cdn-aws.deb.debian.orgg’ /etc/apt/sources.list && sed -i ‘shttp://archive.ubuntu.comhttp://us-east-1.ec2.archive.ubuntu.comg’ /etc/apt/sources.list && sed -i ‘/security/d’ /etc/apt/sources.list && apt-get update &&     xargs -r -a /root/packages.txt apt-get install -y     && rm -rf /var/lib/apt/lists/*CACHED→ COPY --link --chown=1000 --from=lfs /app /home/user/appCACHED→ RUN pip install --no-cache-dir         streamlit==1.17.0CACHED→ WORKDIR /home/user/appCACHED→ COPY --link --chown=1000 ./ /home/user/appDONE 0.0s→ Pushing imageDONE 1.2s→ Exporting cacheDONE 1.5s===== Application Startup at 2023-05-19 11:34:04 =====Traceback (most recent call last):File “/home/user/.local/bin/streamlit”, line 5, infrom streamlit.web.cli import mainFile “/home/user/.local/lib/python3.8/site-packages/streamlit/init.py”, line 55, infrom streamlit.delta_generator import DeltaGenerator as _DeltaGeneratorFile “/home/user/.local/lib/python3.8/site-packages/streamlit/delta_generator.py”, line 45, infrom streamlit.elements.arrow_altair import ArrowAltairMixinFile “/home/user/.local/lib/python3.8/site-packages/streamlit/elements/arrow_altair.py”, line 36, infrom altair.vegalite.v4.api import ChartModuleNotFoundError: No module named ‘altair.vegalite.v4’
2023-05-19T11:50:33Z
Here is another example space where it occurs.  I tried putting altair into requirements.txt but think it has to be a fix to pre-requirements.txt or the streamlit docker.This example for my STEM teaching for instance has minimal includes so close to plain streamlit.  Arrow->Altair might conflict since it needs thev2 versionof Altair I think (rather than attempted v4)docs.streamlit.iost.altair_chart - Streamlit Docsst.altair_chart displays a chart using the Altair library.Function signature[source]st.altair_chart(altair_chart, use_container_width=False, theme=“streamlit”)Parametersaltair_chart (altair.vegalite.v2.api.Chart) The Altair chart object to display.theme=“streamlit”)ModuleNotFoundError: No module named ‘altair.vegalite.v4’Thanks and good luck on fixing!  Much appreciated and cool docker flow.–Aaronhuggingface.coMath Animator 🍎🥕Sankey Snacks🌽🥒 - a Hugging Face Space by awacke1Discover amazing ML apps made by the communityRuntime errorTraceback (most recent call last):File “/home/user/.local/bin/streamlit”, line 5, infrom streamlit.web.cli import mainFile “/home/user/.local/lib/python3.8/site-packages/streamlit/init.py”, line 55, infrom streamlit.delta_generator import DeltaGenerator as _DeltaGeneratorFile “/home/user/.local/lib/python3.8/site-packages/streamlit/delta_generator.py”, line 45, infrom streamlit.elements.arrow_altair import ArrowAltairMixinFile “/home/user/.local/lib/python3.8/site-packages/streamlit/elements/arrow_altair.py”, line 36, infrom altair.vegalite.v4.api import ChartModuleNotFoundError: No module named ‘altair.vegalite.v4’
2023-10-13T00:35:56Z
just for reference here is the solutionStreamlit Spaces with "ModuleNotFoundError: No module named 'altair.vegalite.v4'" errorSpacesthanks@whitphxTo solve the streamlit altair issue add to your  requirements.txt altair<5 
here is a functional example