# ERROR: Could not install packages due to an OSError: [Errno 36] File name too long

- **ID:** `pip/wheel-install-fails-with-errno-36-file-name-too-long`
- **Domain:** pip
- **Category:** system_error
- **Error Code:** `ERROR`
- **Verification:** ai_generated
- **Fix Rate:** 75%

## Root Cause

The extracted wheel file or a path within it exceeds the filesystem's maximum filename length (typically 255 bytes on Linux/ext4, 260 characters on Windows).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| pip 21.0+ | active | — | — |
| Python 3.6-3.12 | active | — | — |
| Linux kernel 5.x+ | active | — | — |
| Windows 10/11 | active | — | — |

## Workarounds

1. **pip install <package> --target /tmp/shorter-path** (80% success)
   ```
   pip install <package> --target /tmp/shorter-path
   ```
2. **pip install <package> --no-compile --no-deps --no-build-isolation** (70% success)
   ```
   pip install <package> --no-compile --no-deps --no-build-isolation
   ```
3. **On Linux: install to a filesystem with longer filename limits (e.g., XFS or ext4 with dir_nlink) or use a symlink to shorten the path: mkdir -p /tmp/shortpip && ln -s /tmp/shortpip ~/shortpip && pip install <package> --target ~/shortpip** (85% success)
   ```
   On Linux: install to a filesystem with longer filename limits (e.g., XFS or ext4 with dir_nlink) or use a symlink to shorten the path: mkdir -p /tmp/shortpip && ln -s /tmp/shortpip ~/shortpip && pip install <package> --target ~/shortpip
   ```

## Dead Ends

- **Using --no-cache-dir option to avoid cache path issues** — The error occurs during wheel extraction, not caching; the filename length issue remains regardless of cache. (95% fail)
- **Upgrading pip to the latest version** — This is an OS-level filesystem limitation; pip's version does not affect filename length constraints. (90% fail)
- **Running pip as administrator or root** — Administrator privileges cannot override filesystem filename length limits. (95% fail)
