Forums

What's the right path setting to read files ?

I'm starting with pythonanywhere and I'm facing a very basic issue. Here is my code

import os
import re
import numpy as np
import pandas as pd
from flask import Flask, request

#Load data into Pandas dataframe
datafile = "movie_metadata_red.csv"
df = pd.read_csv(datafile, low_memory=False)

The file movie_metadata_red.csv is available in the root directory of my site, however I get an error FileNotFoundError I also tried with a /data/ sub directory, putting the files there, but every time I get the same message.

What should I do th have Python find my data files ?

See the help page that we have for that: http://help.pythonanywhere.com/pages/NoSuchFileOrDirectory/

Thanks for the hint. I could solve my issue.

Great!