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)
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
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.
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.