# ERROR: Could not install packages due to an OSError: [Errno 63] File name too long: '/path/to/venv/lib/python3.10/site-packages/...'

- **ID:** `pip/path-too-long-unpack`
- **Domain:** pip
- **Category:** system_error
- **Error Code:** `ERROR`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

pip tries to extract wheel contents into a deeply nested directory structure, exceeding the filesystem's maximum path length limit (typically 255 bytes per component or 4096 bytes total on Linux).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| pip 23.0 | active | — | — |
| pip 24.0 | active | — | — |
| pip 24.2 | active | — | — |

## Workarounds

1. **Install the package with --no-compile to avoid .pyc file generation, which can shorten paths slightly: pip install --no-compile <package>** (40% success)
   ```
   Install the package with --no-compile to avoid .pyc file generation, which can shorten paths slightly: pip install --no-compile <package>
   ```
2. **Use a virtual environment with a very short path (e.g., /tmp/venv) to reduce overall path length: python3 -m venv /tmp/venv && /tmp/venv/bin/pip install <package>** (75% success)
   ```
   Use a virtual environment with a very short path (e.g., /tmp/venv) to reduce overall path length: python3 -m venv /tmp/venv && /tmp/venv/bin/pip install <package>
   ```
3. **Extract the wheel manually and install via setup.py: unzip <package>.whl -d /tmp/extracted && cd /tmp/extracted && python setup.py install** (85% success)
   ```
   Extract the wheel manually and install via setup.py: unzip <package>.whl -d /tmp/extracted && cd /tmp/extracted && python setup.py install
   ```

## Dead Ends

- **Manually rename the wheel file to a shorter name before installing** — The error is caused by the internal directory structure inside the wheel, not the wheel filename itself; renaming the .whl file does not change the extracted paths. (95% fail)
- **Use --no-deps to skip dependency installation** — The error occurs during extraction of the main package, not dependencies; skipping dependencies does not shorten the path of the package itself. (80% fail)
- **Reinstall Python to a shorter path like C:\Python** — While a shorter base path can help on Windows, this error occurs on Linux as well; the core issue is the nested structure inside site-packages, not the Python installation path. (60% fail)
