The main reason that apps fail to build properly is because Streamlit Community Cloud can't find your dependencies! So make sure you:
- Add a requirements file for Python dependencies.
- (optional) Add a
packages.txtfile to manage any external dependencies (i.e Linux dependencies outside Python environment).
Python requirements files should be placed either in the root of your repository or in the same directory as your Streamlit app.
Add Python dependencies
Streamlit looks at your requirements file's filename to determine which Python dependency manager to use in the order below. Streamlit will stop and install the first requirements file found.
Only include packages in your requirements file that are not distributed with a standard Python installation. If any of the modules from base Python are included in the requirements file, you will get an error when you try to deploy. Additionally, we recommend that you use the latest version of Streamlit to ensure full Streamlit Community Cloud functionality.
You should only use one requirements file for your app. If you include more than one (e.g.
Pipfile). Streamlit will first look in the directory of your Streamlit app;
however, if no requirements file is found, Streamlit will then look at the root of the repo.
packages.txt exists in the root directory of your repository we automatically detect it, parse it, and install the listed packages as described below. You can read more about apt-get in their docs.
Add apt-get dependencies to
packages.txt, one package name per line. For example: