Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errno 13 Permission denied Python

Tags:

In python, I am currently experimenting with what I can do with open command. I tried to open a file, and got an error message. Here's my code:

open(r'C:\Users\****\Desktop\File1') 

My error message was:

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\****\\Desktop\\File1' 

I looked on the website to try and find some answers and I saw a post where somebody mentioned chmod. 1. I'm not sure what this is and 2. I don't know how to use it, and thats why I've come here.

like image 290
Jake Avatar asked Jan 28 '17 13:01

Jake


1 Answers

For future searchers, if none of the above worked, for me, python was trying to open a folder as a file.

Check at the location where you try to open the file, if you have a folder with exactly the same name as the file you try to open (the file extension is part of the file name).

like image 196
Alexander Avatar answered Sep 22 '22 16:09

Alexander