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