PermissionError Python Origin: Application & API Last updated 13 Oct 2026

PermissionError: [Errno 13] Permission denied: '/path'

The OS refused the file operation — no permission, a directory passed to open(), or (on Windows) the file is open elsewhere.

Exact message you may see [Errno 13] Permission denied
Seen on: Python

Meaning

On Linux the Python process user lacks rights. On Windows, Excel or another program locking the file also raises Errno 13. Opening a directory path with open() raises it too.

Common causes

  • Process user lacks read/write permission
  • Path is a directory, not a file
  • File locked by another program (Windows)
  • Writing into a system or site-packages directory without a venv

⚡ Quick fix

  1. Check ownership/permissions with ls -l
  2. Make sure the path points to a file
  3. Close the file in other programs
  4. Use a virtual environment instead of sudo pip

Detailed fix by platform

Linux

  1. sudo chown -R $USER:$USER ./output

How to diagnose

  1. Path — File or directory?
  2. User — Which user runs Python?
  3. Lock — Open in another app?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

AADSTS65001 — AADSTS65001: The user or administrator has not consented to use the application (Azure)AADSTS65001Access to the path is denied — System.UnauthorizedAccessException: Access to the path 'x' is denied (.NET)Access to the path is…AccessControlListNotSupported — AccessControlListNotSupported: The bucket does not allow ACLs (AWS)AccessControlListNotS…AccessDeniedException — java.nio.file.AccessDeniedException: /path (Java)AccessDeniedExceptiondaemon — Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (Docker)daemonEACCES — Linux: Permission denied (Linux)EACCESEPERM — Error: EPERM: operation not permitted, rename / unlink (Node.js)EPERMexec permission denied — exec /entrypoint.sh: permission denied (container won't start) (Docker)exec permission deniedPermissio…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.