FileNotFoundError on streamlit's app online but not in local

Hey, I am trying to deploy my first little app. In same directory of the app i have a data directory with some csv file. When I click on link I have error :
FileNotFoundError: [Errno 2] No such file or directory: ‘data/file.csv’

But in local there are functioning so I don’t understand how can I connect the data to my app
the error are in this part of code:
Championshipchoice = st.sidebar.selectbox(“which Championship do you want ?”,(“Tirs_Bundesliga.csv”,“Tirs_PL.csv”,“Tirs_liga.csv”,“Tirs_SerieA.csv”,“Tirs_L1.csv”) )
choice = “data/” + Championshipchoice
TableChoice = pd.read_csv(choice)
So pd.read_csv function don’t find files. I verifying all libraries are in requirements.txt files.

You will probably need to add a path before each filename. Example ./data directory/filename

1 Like

Hi I am in the same problem but thanks to you all, it worked well now to me too. Thanks!

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