Deploying with Streamlit Community Cloud
Now that all of our necessary files are in the GitHub repository, we have almost all that we need to deploy our application. You can use the following list of steps to deploy our application:
- When we deploy to Streamlit Community Cloud, Streamlit uses its own servers to host the app. Because of this, we need to explicitly tell Streamlit which Python libraries are required for our app to run. The following code installs a very helpful library called
pipreqs
and creates arequirements.txt
file in the format we need for Streamlit:pip install pipreqs pipreqs .
- When we look at our
requirements.txt
file, we can see thatpipreqs
looked through all of our Python files, checked what we imported and used, and created a file that Streamlit can use to install the exact same versions of our libraries to prevent errors:
Figure 5.3: Requirements.txt
- We have a new file, so we need to also add it to...