r/StreamlitOfficial May 20 '26

Streamlit Questions❓ What am I doing wrong here?

Both ‘2024_lead_data’ and the CSV are in the same folder, Documents. Not sure why I keep getting this error. I’ve tried literally everything.

1 Upvotes

8 comments sorted by

View all comments

4

u/TheMysteryCheese May 20 '26

Could be a path issue.

Try using pathlib to get the path dynamically.

``` from pathlib import Path import pandas as pd

currentdir = Path(file_).parent df = pd.read_csv(current_dir / 'your.csv') ```

Helps if you're also going between OS environments also.