App stopped working out of nowhere

I had an app that has been working fine for over a month, and then yesterday it just stopped working. I tried deploying an empty commit and restarted the app, but continue to get the following error:

ModuleNotFoundError: No module named ‘importlib_resources’

Traceback (most recent call last):

  File "/home/appuser/venv/bin/streamlit", line 5, in <module>

    from streamlit.cli import main

  File "/home/appuser/venv/lib/python3.8/site-packages/streamlit/__init__.py", line 70, in <module>

    from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator

  File "/home/appuser/venv/lib/python3.8/site-packages/streamlit/delta_generator.py", line 73, in <module>

    from streamlit.elements.arrow_altair import ArrowAltairMixin

  File "/home/appuser/venv/lib/python3.8/site-packages/streamlit/elements/arrow_altair.py", line 23, in <module>

    import altair as alt

  File "/home/appuser/venv/lib/python3.8/site-packages/altair/__init__.py", line 4, in <module>

    from .vegalite import *

  File "/home/appuser/venv/lib/python3.8/site-packages/altair/vegalite/__init__.py", line 2, in <module>

    from .v4 import *

  File "/home/appuser/venv/lib/python3.8/site-packages/altair/vegalite/v4/__init__.py", line 2, in <module>

    from .schema import *

  File "/home/appuser/venv/lib/python3.8/site-packages/altair/vegalite/v4/schema/__init__.py", line 2, in <module>

    from .core import *

  File "/home/appuser/venv/lib/python3.8/site-packages/altair/vegalite/v4/schema/core.py", line 4, in <module>

    from altair.utils.schemapi import SchemaBase, Undefined, _subclasses

  File "/home/appuser/venv/lib/python3.8/site-packages/altair/utils/__init__.py", line 1, in <module>

    from .core import (

  File "/home/appuser/venv/lib/python3.8/site-packages/altair/utils/core.py", line 13, in <module>

    import jsonschema

  File "/home/appuser/venv/lib/python3.8/site-packages/jsonschema/__init__.py", line 12, in <module>

    from jsonschema._format import (

  File "/home/appuser/venv/lib/python3.8/site-packages/jsonschema/_format.py", line 10, in <module>

    from jsonschema.exceptions import FormatError

  File "/home/appuser/venv/lib/python3.8/site-packages/jsonschema/exceptions.py", line 13, in <module>

    from jsonschema import _utils

  File "/home/appuser/venv/lib/python3.8/site-packages/jsonschema/_utils.py", line 12, in <module>

    import importlib_resources as resources  # type: ignore

ModuleNotFoundError: No module named 'importlib_resources'

Can you try Python 3.9 on streamlit cloud?
If this does not help, please share a link to your github repo.

I deleted the app (was python 3.8), redeployed with python 3.9 and it is working now.

2 Likes