Deploying with Streamlit Sharing
Now that all 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 Sharing, 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 and 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: - We have a new file, so we need to also add it to our GitHub repository. The following code...