Streamlit_app.py --- "This file does not exist"

Hi,

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!

Hi @hahahazel,

First, welcome to the Streamlit community! :star: :tada: :partying_face: :star:

Can you link your GitHub repo that you’re deploying from?

Happy Streamlit-ing!
Marisa

Hi Marisa,

https://github.com/igivis7/DRS28_Hazel_n_Igor_portfolio_project

Hazel

HI @hahahazel,

I took a look at the code you sent to me. Your streamlit_app.py file has only one line in it, which is a copy of the file name itself:

streamlit_app.py

I see a bunch of streamlit app files in the folder WorkFolder_Hazel. Is this the code* you want to be deployed?

Also, your repo doesn’t have a requirements.txt file, which you will need so that our cloud platform can install all the dependencies of your app.

Happy Streamlit-ing!
Marisa

Thanks Marisa.

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.

https://docs.google.com/spreadsheets/d/1yXGRegA1jLHUw5uuOLt1djhaZjBKl8ZfRNgiK0haJZ8/edit?usp=sharing

Thanks,
Hazel

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.

See our docs on app dependencies for more info:

Happy Streamlit-ing!
Marisa

Hi Marisa,

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.

Thanks for the resources.

Regards,
Hazel

Hey @hahahazel,

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!

Happy Streamlit-ing
Marisa

Hi Marisa,

Yes, I have tried 15 different demo on Streamlit before moving on public GoogleSheets, They were on my Github <https://github.com/igivis7/DRS28_Hazel_n_Igor_portfolio_project/tree/main/WorkFolder_Hazel>.

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.

Hey @hahahazel,

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:

my_database = "https//:docs.google.com/spreadsheets/d/my_rul/etc" 

Happy Streamlit-ing!
Marisa

Thank you Marisa!

I have another question. I posted it earlier today on forum. Can you help me out?

https://discuss.streamlit.io/t/turn-vertical-bar-chart-to-horizontal/20107

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.