Isha Bhatt
Isha Bhatt

Reputation: 13

IOError: [Errno 2] No such file or directory - file from the same directory

For some reason when I do the following:

filename = 'time_series_covid_confirmed_US.csv'
with open (os.path.join("mnt/c", "Users/ibhat/repo/nasa-hackathon-2020/covid-parsing", filename)) as csv_file:

I get "No such file or directory" when trying to access a csv file. Any ideas?

Upvotes: 0

Views: 65

Answers (1)

adamgy
adamgy

Reputation: 5583

You need to add a forward slash before mnt:

filename = 'time_series_covid_confirmed_US.csv'
with open (os.path.join("/mnt/c", "Users/ibhat/repo/nasa-hackathon-2020/covid-parsing", filename)) as csv_file:

Upvotes: 1

Related Questions