Home > Back-end >  FileNotFoundError even with seemingly valid code
FileNotFoundError even with seemingly valid code

Time:10-09

I'm learning how to use Pandas in Python and for some reason, it keeps telling me

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\jebra\NFL.csv'

Below is my code, any help would be most appreciated!

import pandas as pd

df = pd.read_csv(r'C:\Users\jebra\NFL.csv')
print(df)

CodePudding user response:

Ignore me, my code was tryign to read a csv file, but the file I was trying to use was xlsx. Thank you

CodePudding user response:

Please show the output of the cmd command whoami. I think you have copied the code from somewhere else and are trying to run it .

And maybe you are inputting a wrong path. Could you verify that by right-clicking on that file and showing us the property details of the file 

  • Related