1

I tried to read a file from directory. Jupyter threw a permission error [Errno 13]

The code

data = pd.read_csv("D:/Sies Files/sem2/Machine Learning/Practicals/Dataset")

print(data,"n")

The Error

---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
<ipython-input-3-0c5a5bfd77a7> in <module>
----> 1 data = pd.read_csv("D:/Sies Files/sem2/Machine Learning/Practicals/Dataset")
      2 print(data,"n")

PermissionError: [Errno 13] Permission denied: 'D:/Sies Files/sem2/Machine Learning/Practicals/Dataset'
Enos jeba
  • 72
  • 1
  • 3
  • 10

3 Answers3

3

change the ownership of the directory from root to user

see here [Errno 13] Permission denied : https://github.com/ipython/ipython/issues/8997

and here : Cannot open new Jupyter Notebook [Permission Denied]

You have to change the ownership of your files inside that directory or inside jupyter files, wherever it gives you PermissionError to make it work

1

You can't read a folder/path .You need to give something like path+filename You can use below code where yourFileName.csv represents you want to read

data = pd.read_csv("D:/Sies Files/sem2/Machine Learning/Practicals/Dataset/yourFileName.csv")
Deepak
  • 470
  • 1
  • 3
  • 15
0

try doing - data = pd.read_csv(r"D:/Sies Files/sem2/Machine Learning/Practicals/Dataset/yourFileName.csv")