The message
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'c:\python39\scripts\pip.exe' Consider using the `--user` option or check the permissions. (deutsch: Zugriff verweigert)
Affects: Python, ComfyUI, AUTOMATIC1111 Stable Diffusion WebUI, Stable Diffusion WebUI Forge, TextGen (text-generation-webui)
Why is this happening?
Windows locks program files while they are running. If you run pip install --upgrade pip directly through pip.exe, pip tries to delete that same running file. Another common reason: Python is in a folder where you do not have write permission without administrator rights. If an AI program is still running, its packages are locked too.
How to fix it
- Close all windows where the program or Python is still running (for example, the ComfyUI or WebUI console).
- Run pip through Python instead of directly:
python -m pip install --upgrade pip(on Windows alsopy -m pip install --upgrade pip). For portable ComfyUI:.\python_embeded\python.exe -m pip install --upgrade pip. - If Python is in a protected folder (for example
C:\Program FilesorC:\Python39for all users), open the terminal with right-click "Run as administrator" and repeat the command. - Alternatively, the message itself suggests the
--useroption, which installs pip in your user folder:python -m pip install --user paketname. - If pip is then missing altogether ("No module named pip"), restore it with
python -m ensurepip --upgrade. - In the long run, it is easier to install Python in a folder where you have write permission without administrator rights.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- 'python' is not recognized or opens the Microsoft Store
- ImportError: DLL load failed while importing …: The specified module could not be found – a Python package is missing a Windows DLL
- No matching distribution found for torch (wrong Python version)
- Path too long: Filename too long / Windows Long Path support
- pip: Microsoft Visual C++ 14.0 or greater is required
Sources
- https://github.com/pypa/pip/issues/9527
- https://mail.python.org/pipermail/python-list/2015-June/842938.html
- https://bugs.python.org/msg339460
- https://pip.pypa.io/en/stable/installation/
Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.