Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problems0x80070005—sometimes mistyped as ox80070005—is Windows’ E_ACCESSDENIED result. In a Python workflow it usually means that the account running Python cannot read, create, replace, or register something at the location involved. The failing operation might be the Python installer, pip writing to site-packages, an interpreter launch, or Windows component servicing.
The safest fix is to identify that operation first, then install into a user-writable virtual environment or per-user location. Do not start by changing permissions on WindowsApps, Program Files, or other system directories. The steps below separate Python permission problems from genuine Windows Update failures.
As an Amazon Associate I earn from qualifying purchases.
What 0x80070005 means in a Python error
Microsoft defines Windows Update error 0x80070005 (E_ACCESSDENIED) as a failure to access required files, folders, or registry entries. The same code is not exclusive to Windows Update. Python and pip can surface it when Windows denies access to an installation directory, package target, executable, registry location, or a file locked by security software.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →You may see any of these forms:
0x80070005or the commonly mistypedox80070005WinError 5PermissionError: [Errno 13] Permission deniedAccess is deniedwhile installing Python or a package
The code describes the permission failure, not its exact cause. A package installation into a machine-wide directory, a Microsoft Store Python installation under WindowsApps, a second Python found earlier on PATH, and a locked file can all produce similar messages.
#1 Best Overall
First determine which operation failed
Copy the complete command and traceback before changing anything. The correct branch depends on what the last operation was.
| Symptom or named path | Likely failure layer | Start with |
|---|---|---|
| The Python installer stops while creating or modifying an installation | Installer target, UAC, or an existing installation | Confirm the selected install scope and choose a writable per-user location |
pip fails while writing site-packages, a wheel, or a project directory |
Package target or file lock | Use the interpreter-specific python -m pip command and a virtual environment |
Launching python.exe or a script returns WinError 5 |
Executable, folder, policy, or security software access | Check which executable is being called and inspect the named path |
| Windows Update or component servicing reports 0x80070005 | Windows servicing permissions or component store | Use the Windows Update branch later in this guide |
If the traceback names pip, site-packages, python.exe, or your project folder, stay on the Python path. Do not run DISM or reset Windows Update components merely because a package install failed.
Capture the interpreter and pip that are actually running
Multiple Python installations are common: a python.org installation, a Microsoft Store installation, and one or more virtual environments can all coexist. A standalone pip command may belong to a different interpreter than the one that runs your program.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →- Open PowerShell or Command Prompt in the project directory.
- Run:
where python
python --version
python -m pip --version
The final line reports the pip associated with the python command. Compare the displayed path with the project and installation you intended to use.
When the Python launcher is available, list or select a specific version with its interpreter-specific form:
Rank #2
py -3.x -m pip --version
py -3.x -m pip install <package-name>
Replace 3.x with the version you installed, such as 3.12. The py.exe launcher selects installed Python versions for python.org-style installations. A Microsoft Store installation does not provide the legacy py command in the same way, so use the full interpreter path or the python command that Windows associates with that installation.
If where python shows an unexpected directory, correct the command before troubleshooting permissions. Calling the intended interpreter explicitly prevents you from repairing one installation while pip continues to modify another.
Preferred fix: install inside a writable virtual environment
A virtual environment keeps package files in your project directory instead of a machine-wide Python directory. It normally requires no administrator rights and is easier to remove than an ACL change.
- Change to the project directory.
- Create the environment:
py -m venv .venv
If your installation does not provide py, use:
python -m venv .venv
- Activate it in PowerShell:
..venvScriptsActivate.ps1
- Upgrade the environment’s package installer and install the package:
python -m pip install --upgrade pip
python -m pip install <package-name>
After activation, where python should show a path under .venvScripts. Keep using python -m pip so the package is installed into that same environment.
If PowerShell blocks activation
An execution-policy message is a separate PowerShell restriction, not proof that the environment is broken. You have two alternatives:
- Open Command Prompt and run
.venvScriptsactivate.bat. - Skip activation and call the environment’s interpreter directly:
..venvScriptspython.exe -m pip install <package-name>
This direct form is also useful in scripts, editors, and scheduled tasks where shell activation is inconvenient.
Install per user when a global package is unnecessary
A package install targeting Program Files or another machine-wide directory can fail because a standard account cannot write there. If the package only needs to be available to your account, use:
python -m pip install --user <package-name>
This places the package in your user site rather than the protected global site. If the installation succeeds but a command is reported as “not found,” locate the user-site Scripts directory using Python’s site information and add that directory to your user PATH. Restart the shell after changing PATH.
A per-user install is not a substitute for a virtual environment when projects need different versions. Use a virtual environment for project isolation; use --user for a simple account-wide command that does not need machine-wide availability.
Reinstall Python for the current user if the location is protected
If the original installation is in C:Program Files, WindowsApps, or another directory your account cannot modify, reinstalling for the current user in a writable path is safer than taking ownership of the protected directory.
- Close Python, IDEs, terminals, and services that may be using the installation.
- Check
where pythonand record every existing installation. - Uninstall the unwanted installation through Windows’ installed-apps settings, or leave it in place if another application depends on it.
- Install Python for the current user and choose a location that your account can write to. Avoid manually granting broad write access to
WindowsAppsor system folders. - Open a new terminal and repeat
where python,python --version, andpython -m pip --version.
Microsoft Store Python can be protected because its files are managed under WindowsApps. The Python issue tracker records access-denied cases when pip attempts to write there. In that situation, use a virtual environment, a per-user install, or a current-user Python installation instead of modifying the Store directory’s ACLs.
Use administrator elevation only for a defined reason
Right-clicking a terminal and choosing Run as administrator can distinguish a permission problem from a broken installer, but elevation is not a requirement for every Python command. Running development tools elevated can create root-owned or administrator-owned files that your normal account later cannot replace.
Use an elevated installer only when you intentionally need a machine-wide installation and have permission to administer the computer. For ordinary projects, close the elevated shell, create a virtual environment as your normal user, and install there. If an administrator-only command succeeds while the normal command fails, inspect the target directory’s ownership and permissions rather than treating elevation as the permanent fix.
Check the target folder, ownership, and file locks
Read the path named in the traceback. Confirm that:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
- The directory exists and is the directory belonging to the interpreter you selected.
- Your account has permission to create and modify files there.
- The destination is not a protected Windows directory or a network location with separate permissions.
- An existing file is not marked read-only or held open by Python, an editor, an installer, or security software.
- The drive has available space and the path is reachable under the account running the command.
Do not recursively change permissions on WindowsApps, WinSxS, Program Files, or the Windows directory as a first response. Broad ACL changes can weaken the machine and still leave the wrong interpreter selected.
Best Value
Security software and managed computers
Microsoft identifies third-party antivirus or security tools that lock update files, incorrect folder permissions, and restricted write access among possible causes of 0x80070005. On a personally managed computer, you can test whether a security product is holding the exact file named in the traceback, following that product’s documented procedure. On a work or school device, ask the administrator to make the test; do not disable managed protection casually.
Restore normal protection immediately after a controlled test. If the failure disappears only when a security control is relaxed, create an appropriate, narrowly scoped exception with the administrator rather than leaving protection disabled.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Separate Python errors from Windows Update and component failures
Use the Windows repair path only when Windows Update, servicing, or a component-repair operation itself reports 0x80070005. Evidence includes an update history entry, a Windows Update dialog, or a servicing log—not merely a Python traceback.
Recommended Free Tools
Repair the component store, then system files
- Open Windows Terminal or Command Prompt as an administrator.
- Run:
DISM /Online /Cleanup-Image /RestoreHealth
- After DISM completes, run:
sfc /scannow
- Restart Windows and retry the update or servicing operation.
DISM repairs the online Windows component image; System File Checker then checks protected system files. These commands do not grant pip permission to write into a Python directory, so running them for a normal package-install error is unlikely to address the actual failure.
Reset Windows Update permissions only in the Windows Update branch
Microsoft’s documented 0x80070005 procedure also addresses permissions on %windir%WinSxS and resets the %windir%SoftwareDistribution update cache and related update components. Follow that procedure exactly for the Windows edition and account you administer, restart, and retest. Do not improvise recursive ownership or ACL commands on those directories based solely on a pip error.
Compare the available approaches
| Approach | Scope | Privilege | Reversibility | Installation source or target | Failure layer addressed |
|---|---|---|---|---|---|
| Virtual environment | Single project | Normal user | High; delete .venv and recreate |
Project directory | Package target and interpreter mismatch |
pip install --user |
One Windows account | Normal user | High; uninstall packages or remove the user site | User site | Global-site write denial |
| Current-user Python installation | That user’s Python installation | Normal user | Moderate; reinstall or remove the installation | User-writable installation path | Protected global or Store installation |
| Administrator global install | Whole machine | Administrator | Lower; affects other users and applications | Program Files or another machine location |
Intentional machine-wide deployment |
| ACL or ownership changes | Selected protected folder | Administrator | Low; can affect Windows servicing and security | System-managed directory | Specific, confirmed permission defect only |
| DISM, SFC, and Windows Update reset | Windows servicing | Administrator | Moderate; changes servicing state | Windows component store and update cache | Confirmed Windows Update or component failure |
The least-privilege order is deliberate: use a virtual environment first, then a per-user location, then a current-user reinstall. Reserve elevation, ACL changes, and servicing repairs for evidence that those broader layers are involved.
What to do after each change
- Open a fresh terminal so updated
PATHvalues and activation state are loaded. - Run
where pythonandpython -m pip --versionagain. - Repeat the smallest failing command, not an unrelated large installation.
- Confirm the package or interpreter works from the same account and directory that originally failed.
- If it still fails, preserve the new traceback, including the full path and the account or shell used.
A changed error is useful evidence. For example, moving from an access-denied path under WindowsApps to a dependency-resolution error in .venv means the permission problem was bypassed and the remaining issue is in package compatibility or dependencies.
Common mistakes that make 0x80070005 worse
- Using bare
pip: it may target a different Python. Preferpython -m piporpy -3.x -m pip. - Installing every project globally: this creates avoidable write restrictions and version conflicts. Use
.venv. - Changing WindowsApps permissions: Store-managed files are protected by design. Select a writable environment instead.
- Always running as administrator: it can hide the real target mismatch and create files your normal account cannot edit.
- Disabling security tools broadly: test only the named file or operation, follow policy, and restore protection immediately.
- Running DISM for every Python error: servicing commands belong to a confirmed Windows Update or component-store failure.
- Ignoring old installations: an obsolete interpreter earlier on
PATHcan make a successful install appear ineffective.
When the problem is fixed
You have resolved the permission layer when the intended interpreter is selected, python -m pip --version points to that interpreter or its virtual environment, and the original command can create or update files in its target without elevation. Keep the project environment reproducible, document which Python version it uses, and avoid granting permanent write access to system-managed directories.
Quick Recap
As an optional shortcut after the manual checks, Outbyte PC Repair can look for common Windows issues, adjust settings, clean temporary and cache files, and provide an app-crash log. It complements antivirus software rather than replacing it, results vary, and no utility repairs every crash. It runs on Windows 11, 10, 8, and 7; a free trial is available by category for at least two days before a subscription is required.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

