pandas.read_csv FileNotFoundError: File b'\xe2\x80\xaa<etc>' despite correct path

Try this and see if it works. This is independent of the path you provide.

pd.read_csv(r'C:\Users\aiLab\Desktop\example.csv')

Here r is a special character and means raw string. So prefix it to your string literal.

https://www.journaldev.com/23598/python-raw-string:

Python raw string is created by prefixing a string literal with ‘r’ or ‘R’. Python raw string treats backslash () as a literal character. This is useful when we want to have a string that contains backslash and don’t want it to be treated as an escape character.


$10 says your file path is correct with respect to the location of the .py file, but incorrect with respect to the location from which you call python

For example, let's say script.py is located in ~/script/, and file.csv is located in ~/. Let's say script.py contains

import pandas
df = pandas.read_csv('../file.csv') # correct path from ~/script/ where script.py resides

If from ~/ you run python script/script.py, you will get the FileNotFound error. However, if from ~/script/ you run python script.py, it will work.


I know following is a silly mistake but it could be the problem with your file.

I've renamed the file manually from adfa123 to abc.csv. The extension of the file was hidden, after renaming, Actual File name became abc.csv.csv. I've then removed the extra .csv from the name and everything was fine.

Hope it could help anyone else.