(Errno 2) No such file or directory: ‘C:/Users/Пользователь/Downloads/Train_rev1.csv’

I have a problem.

data = pd.read_csv('C:/Users/Пользователь/Downloads/Train_rev1.csv', encoding='cp1252')

FileNotFoundError: [Errno 2] No such file or directory: ‘C:/Users/Пользователь/Downloads/Train_rev1.csv’.

The file itself is located there.
What to do?

Initially, there were problems with encoding. I changed it, then tried to put

(r' ', encoding='cp1252')

but this didn’t solve the problem either.

  • Welcome! Shoudn’t it be (escaped) backslashes for Windows paths? Like this: 'C:\\Users\\Пользователь\\Downloads\\Train_rev1.csv'?

    – 




One simple solution :

  1. Create a folder data in your working directory
  2. Move the CSV file to data folder
  3. Read the file using :
pd.read_csv('data/Train_rev1.csv')

Leave a Comment