Problem
When you run your app locally or on Streamlit Community Cloud, you see an error message that starts with ModuleNotFoundError.
Solution
If youâre running your app locally, youâre seeing this error message because you havenât installed all the dependencies used by your app. Use pip
or your package manager of choice to install the packages used by your app (you can also add a list of your appâs dependencies to a requirements.txt
file and run pip install -r requirements.txt
to install them all).
If your app is deployed on Streamlit Community Cloud, the GitHub repository for your app is likely missing a requirements.txt
file (never heard of a requirements.txt
file? Check out this guide). Add a requirements.txt
file that contains the full list of your appâs dependencies to your appâs repo.
Hereâs an example of what the contents of your requirements.txt
file might look like:
streamlit
openai
llama-index==0.10.4
nltk
httpx
pypdf
If your repo already includes a requirements.txt
file, that file is most likely missing the dependency mentioned in the error message.