Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Streamlit for Data Science - Second Edition

You're reading from  Streamlit for Data Science - Second Edition

Product type Book
Published in Sep 2023
Publisher Packt
ISBN-13 9781803248226
Pages 300 pages
Edition 2nd Edition
Languages
Author (1):
Tyler Richards Tyler Richards
Profile icon Tyler Richards

Table of Contents (15) Chapters

Preface An Introduction to Streamlit Uploading, Downloading, and Manipulating Data Data Visualization Machine Learning and AI with Streamlit Deploying Streamlit with Streamlit Community Cloud Beautifying Streamlit Apps Exploring Streamlit Components Deploying Streamlit Apps with Hugging Face and Heroku Connecting to Databases Improving Job Applications with Streamlit The Data Project – Prototyping Projects in Streamlit Streamlit Power Users Other Books You May Enjoy
Index

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:

  1. 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 a requirements.txt file in the format we need for Streamlit:
    pip install pipreqs
    pipreqs .
    
  2. When we look at our requirements.txt file, we can see that pipreqs 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

  1. We have a new file, so we need to also add it to...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}