How to Fix Python PermissionError: [WinError 5] Access Is Denied
We will briefly introduce how to resolve the PermissionError: [WinError 5] Access is denied
in Python.
PermissionError: [WinError 5] Access is denied
in Python
The PermissionError: [WinError 5] Access is denied
is a very common error message that appears while using Python on Windows. This error might occur when we import Python packages, run a script, or update or install any Python packages.
Almost all python developers encounter this error at some stage in their careers. The error message is shown below.
From the above image, I tried to install the setuptools
using pip, and it gave me the PermissionError: [WinError 5] Access is denied
. The solution is very simple, follow the steps below:
-
Go to search and write
cmd
, right-click on it, and run it as an administrator, as shown below. -
Now, we will run the command again, and it will work just fine, as shown below.
When we run the cmd as an administrator and run the command or install or update any package, it works fine without giving any error.
Rana is a computer science graduate passionate about helping people to build and diagnose scalable web application problems and problems developers face across the full-stack.
LinkedInRelated Article - Python Error
- Can Only Concatenate List (Not Int) to List in Python
- How to Fix Value Error Need More Than One Value to Unpack in Python
- How to Fix ValueError Arrays Must All Be the Same Length in Python
- Invalid Syntax in Python
- How to Fix the TypeError: Object of Type 'Int64' Is Not JSON Serializable
- How to Fix the TypeError: 'float' Object Cannot Be Interpreted as an Integer in Python