App dependencies

The main reason that apps fail to build properly is because Streamlit Cloud can't find your dependencies! So make sure you:

  1. Add a requirements file for Python dependencies.
  2. (optional) Add a packages.txt file to manage any external dependencies (i.e Linux dependencies outside Python environment).
push_pin

Note

Python requirements files should be placed either in the root of your repository or in the same directory as your Streamlit app.

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.

FilenameDependency ManagerDocumentation
Pipfilepipenvdocs
environment.ymlcondadocs
requirements.txtpipdocs
pyproject.tomlpoetrydocs
push_pin

Note

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, use versions 0.69.2+ of Streamlit to ensure full Streamlit Cloud functionality.

priority_high

Warning

You should only use one requirements file for your app. If you include more than one (e.g. requirements.txt and 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.

If packages.txt exists in the 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:

    freeglut3-dev
    libgtk2.0-dev

Was this page helpful?

editSuggest edits
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.