Solved – errno 13 permission denied python
Posted on: March 12, 2021 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
.
Share on social media
//