close

[Solved] pandas.read_csv FileNotFoundError: File b’\xe2\x80\xaa‘ despite correct path

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error pandas.read_csv FileNotFoundError: File b’\xe2\x80\xaa’ despite correct path in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How pandas.read_csv FileNotFoundError: File b’\xe2\x80\xaa’ despite correct path Error Occurs?

Today I get the following error pandas.read_csv FileNotFoundError: File b’\xe2\x80\xaa’ despite correct path in python.

How To Solve pandas.read_csv FileNotFoundError: File b’\xe2\x80\xaa’ despite correct path Error ?

  1. How To Solve pandas.read_csv FileNotFoundError: File b'\xe2\x80\xaa' despite correct path Error ?

    To Solve pandas.read_csv FileNotFoundError: File b'\xe2\x80\xaa' despite correct path Error For my particular issue, the failure to load the file correctly was due to an “invisible” character that was introduced when I copied the filepath from the security tab of the file properties in windows.

  2. pandas.read_csv FileNotFoundError: File b'\xe2\x80\xaa' despite correct path

    To Solve pandas.read_csv FileNotFoundError: File b'\xe2\x80\xaa' despite correct path Error For my particular issue, the failure to load the file correctly was due to an “invisible” character that was introduced when I copied the filepath from the security tab of the file properties in windows.

Solution 1

For my particular issue, the failure to load the file correctly was due to an “invisible” character that was introduced when I copied the filepath from the security tab of the file properties in windows.

This character is e2 80 aa, the UTF-8 encoding of U+202A, the left-to-right embedding symbol. It can be easily removed by erasing (hitting backspace or delete) when you’ve located the character (leftmost char in the string).

Note: I chose to answer because the answers here do not answer my question and I believe a few folks (as seen in the comments) might meet the same situation as I did. There also seems to be new answers every now and then since I did not mark this question as resolved.

Solution 2

$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.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read