Filepath problem while deploying in streamlit share

I’ve been trying to upload my project on the streamlit sharing platform, i am struggling with finding out how filepaths work on streamlit share
all of the images that i am acccessing are stored inside the apps folder

title = Image.open('apps/title.png')
st.image(title, caption=' ')

this is how i am trying to access the image(PIL is imported as Image),i am using apps/title.png because someone mentioned in a post that you have to be precise with filepaths but it still doesn’t work.

this is the error i am getting, please help!

The script you are running seems to be in the same directory as the image.

In this case you shouldn’t put the apps folder in the file paths, as python will be looking for an apps directory within the apps directory folder.

1 Like