Hi guys I have recently designed a web application for our hospital it ran successfully on the local host however when I tried to deploy on streamlit cloud it consistently returned an error that no such file (the data source) exists I tried repeatedly but to no avail may you help me fix this problem Have a look at the attached picture
Thanks in advance
Hey @Mohammed_Bahageel,
It looks like your app’s get_data() method can not open and read an Excel file at path data\\datasethospital.xlsx.
Apparently, the file was not found in the given path.
- Did you include the file in the GitHub repository?
- If yes, and if you put it into a directory called
data, make sure to provide a path that is OS-agnostic like:
from pathlib import Path
path = Path("data") / "datasethospital.xlsx"
Hope that helps!
Yes I transferred the data sheet into the same repository
Backslashes in files paths will not work on Streamlit Cloud. Your file path may work on a local, Windows environment using backslashes, but Streamlit Cloud is Debian. That is a key part of “OS-agnostic.”
Another way to do what @arnaud said is to use:
./data/datasethospital.xlsx for your path. Both Windows and Streamlit Cloud will understand the forward slashes.

