Loading files (such as css) when app is being deployed - Error file not found


I’m deploying an app that has a specific github folder structure to the project at hand. In this case, I also have a css folder and I need to access the css file inside this folder. The github path would then be something like:


And I was trying to it like this:

from load_css import local_css

I keep getting file not found error. This should work, no? Does streamlit keep the folder structure from the github repo? How can I access files inside a given folder then?

As an overview, the folder structure looks like this (not all folders are here):

β”œβ”€β”€ .streamlit/
β”‚   └── config.toml
β”œβ”€β”€ backend/
β”‚   └── pivots/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ config.py
β”‚       └── pivots.py
β”œβ”€β”€ config.toml
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ __pycache__/
β”‚   β”‚   β”‚   └── load_css.cpython-39.pyc
β”‚   β”‚   β”œβ”€β”€ load_css.py
β”‚   β”‚   └── main.py
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── style.css
β”‚   β”œβ”€β”€ images/
β”‚   β”‚   β”œβ”€β”€ test.png
β”‚   └── tools/
β”‚       β”œβ”€β”€ __init__.py
β”‚       └── utility.py
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ tests/


I am having the same issue as well. Any ideas on what you did to resolve this issue?

The observation above looks right. So why would you put this in your code instead?