Home > other >  FileNotFoundError: [Errno 2] No such file or directory Pandas
FileNotFoundError: [Errno 2] No such file or directory Pandas

Time:02-19

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

CodePudding user response:

Try this:

pd.read_excel(r"C:\Users\selman\PycharmProjects\selman_learning\bisiklet_fiyatlari.xlsx")

CodePudding user response:

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)

CodePudding user response:

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

Do the above

CodePudding user response:

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

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