I am new to Streamlit. I set up the account and follow the instructions to link my Github. I have a school project in Github that I would like to deploy in Streamlit.
When I try to deploy the app, under “Main file path” , “streamlit_app.py” is already by default but when I click “Deploy”. It said “This file does not exist”. See screenshot. Any advice is much appreciated!
I am very new to Python and Streamlit. Please bear with me asking beginner questions.
Yes, I was trying different demo on your website to see it deploy. My steps: open VS code and create a new file. Copied and Pasted the demo code into my VS Code python file. Run it on terminal to see how it sees.
Now, I want to do the deploy on my project. How do I get started? I linked it to my Github
How to create requirements.txt file?
here is a GoogleSheets I just created and want to see it in deployment.
OK so since you are so new to python and Streamlit I would suggest trying something simpler first.
To connect a Google sheet is possible but is probably more advanced than what you were thinking. Check out our docs on how to connect to databases:
Your code on GitHub needs to be up to date with the code from your streamlit_app.py locally. So if locally, you have copy-pasted in some code from an example you need to save the file and push your changes to your remote repo.
Any python package you use (i.e. import at the top of your python file) needs to be included in your requirements file. Simply as a list, you can specify a specific version number but let’s start with just listing your various packages and see if that works.
I was trying to connect Streamlit to data sources: public GoogleSheets (the same link in your previous email) but not successful. Which database would you suggest me to use? I dont have any other experience with other listed.
The easiest way, in my opinion, is to use a public Google sheet. But I think, first you should try a mini deployment with an app that uses a data file that is in your repo. After you get that working you can extend to something more advanced like connecting to a live Google sheet.
First, download your Google sheet as a csv and commit it to your github repo.
You can then pull your data in using pandas, display it, and possibly make some graphs.
Then test deployment and get that working. Once your app is deployed you never have to take it down, as streamlit will automatically detect new commits to your GitHub and update your app!
I am currently a Data Science student and we have our presentation next Tuesday. I already have the machine learning model trained (see picture) but we would like to show it on Streamlit on our Demo day.
However, I am very new to Streamlit (referred by a friend of how good this product is!) and not sure how to link both together.
Ok, I took a look at your updated code and since you already have your google sheet I think the easiest thing is to follow the instructions from the point below (Make sure your sheet permissions are set to anyone who has the link):
This uses the python package gsheetsdb, the instructions on how to install are here (you will need to add this to your requirements.txt file)
Once you have that installed and it’s running on your local machine (for testing purposes). You can pass your secrets variable and URL to the cloud’s secrets.
When you’re deploying your app click on “Advanced settings…”, can in the secrets box, copy-paste in your spreadsheet info:
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.