Free | No tracking | Every fact with a source|German and English

Error / Installation

Path too long: Filename too long / Windows Long Path support

A file path is longer than the classic Windows limit of 260 characters.

The message

error: unable to create file …: Filename too long  |  ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '…' HINT: This error might have occurred since this system does not have Windows Long Path support enabled.

Affects: Git for Windows, Python, ComfyUI, AUTOMATIC1111 Stable Diffusion WebUI, Stable Diffusion WebUI Forge, TextGen (text-generation-webui), Stability Matrix

Why is this happening?

Windows limits paths to 260 characters by default. AI programs have deeply nested folders (venv, custom nodes, model folders); if the program is also installed in a long path like Desktop or a OneDrive folder, the limit is quickly exceeded. Git for Windows refuses such files by default, and pip stops with an OSError.

How to fix it

  1. Install the program in a short path, for example C:\KI\ComfyUI, not on the Desktop, in Downloads, or in OneDrive.
  2. Enable long path support: Open PowerShell as administrator and run: New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force. Then restart the PC.
  3. For Git as well: git config --global core.longpaths true. Then repeat the clone or update command.
  4. In Stability Matrix, there are separate switches for this in the settings: "Enable Long Paths" for Git and under System Settings for Windows.
  5. If pip reports that a single file or folder name is longer than 255 characters, this setting won't help; then the only option is a shorter installation path.

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 21, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.