This content originally appeared on CodeSource.io and was authored by Deven
In this article, you will learn how to solve errno 13 permission denied python error.
Let’s look at a code example that produces the same error.
Create a Csv file fruitslist.csv
Mango,2,0
Potato,5,2
Onion,4,1
ladyfinger,2,3
and import it in the code snippet below:
import csv
with open("fruitslist.csv", "r") as file:
list = csv.reader(file)
for r in list:
print(r)
Output
PermissionError: [Errno 13] Permission denied: 'fruitslist.csv'
In order to solve errno 13 permission denied python error we have to give Python right permissions to access a file.
In your terminal execute the following command:
chown admin:admin fruitslist.csv
or
chmod 755 fruitslist.csv
Note – Don’t forget to Replace admin
with your username
.
The post Solved – errno 13 permission denied python appeared first on CodeSource.io.
This content originally appeared on CodeSource.io and was authored by Deven

Deven | Sciencx (2021-03-12T04:45:02+00:00) Solved – errno 13 permission denied python. Retrieved from https://www.scien.cx/2021/03/12/solved-errno-13-permission-denied-python/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.