'FileNotFoundError: [Errno 2] No such file or directory Pandas

I am trying to read my excel file with pd.read_excel in python. But ı am get this error message = FileNotFoundError: [Errno 2] No such file or directory

I put my excel file same place with my python file. pic1 pic2



Solution 1:[1]

I think you need to put file object and not only the path of the file. Try to use:

with open("<path to your file>", encoding = 'utf-8') as f:
     pandas.read_excel(f)

Solution 2:[2]

import pandas as pd
path = 'absolute_path/records.xlsx' #eg. C:\\Projects\\readexcel\\file\\records.xlsx
df = pd.read_excel(path)

Do the above

Solution 3:[3]

I think you can modify the code by writing it in this way:

pd.read_excel("./<file name>")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ste1213
Solution 2 JaySean
Solution 3