Home » Python – IOError: [Errno 13] Permission denied:

Python – IOError: [Errno 13] Permission denied:

To solve Python – IOError: [Errno 13] Permission denied: error follow below methods. Python interpreters can only open, read from, and write to files if they have the proper permissions. You’ll get the PermissionError: [errno 13] permission refused error if you try to access, read from, or write to a file over which Python has no permissions.

ERROR LOG

Python – IOError: [Errno 13] Permission denied:

How to solve Python – IOError: [Errno 13] Permission denied

When you attempt to access a file from Python without having the proper rights, you will receive the PermissionError: [errno 13] permission refused error.

To resolve this problem, use the chmod or chown command to adjust the file’s permissions so that only the appropriate user and/or group may access it.

Refer the given method to solve the issue.

Giving permissions to file

Initially check the file permissions using the following command: ls -la

If we can see that the file you are trying to accessing is owned by the user then run the below command. Modify the file_name with the name of the file you are accessing.

chmod 755 file_name

Hope the above solution works.

Also read : ImportError: No module named statsmodels.api