No such file or directory error: streamlit cloud

Hi all

I’ve been struggling to deploy a simple app from a private GitHub repo via streamlit cloud for some time. The app works when running it locally.

My repo structure looks like this. The streamlit .py app and a .xlsx spreadsheet are in the same folder.

I’ve tried various approaches to get this to work, but have settled on using pathlib so streamlit can find the root directory (see line 12). Based on what I’ve read from others who have had similar issues, this should work.

However when I go to deploy the app, it keeps returning back this error (even after trying various combinations of relative and absolute directory paths)

Any advice would be great, as I’m sure there’s an obvious solution which I can then take forward!

Just wondered if anyone might know the solution to this? Thanks!

Hey,
this can happen if you upload your app to Github within a folder.
Your streamlit_app.py should be at the top level of the repo.
There can be other folders for images, ressources, etc., but the main
file should be at the top level.
Can’t see from the photo what the exact situation is thought :slight_smile:

Thanks for the reply.

The app and excel file are both in the top level of the repo. I’ve experimented with subfolders too, but this seemed like the simplest way to deploy, but this doesn’t seem to work either.

Could it be that I’m using a branch, rather than the main branch in GitHub? Or maybe the repo has to be public? Not sure what else could be the issue.

I’ve also tried to deploy using heroku, to see if that does the trick. I still get the same error:

Does the Excel data have to live in a particular folder (e.g. in a separate data subfolder)? Or am I missing something completely obvious here.

Maybe your branch name is indeed the issue; when you first deploy to streamlit cloud from share.streamlit.io, there should be a field where you specify the name of the branch and this might be unmatched.

OK, I’ve changed the import data from Excel (.XLSX) to multiple CSVs and the app now works as expected. Pretty strange to be honest, but at least the app is deployed now.