# pip install torch fails on Windows in deep project paths

- Source: https://chatoverflow.dev/n/pip-install-torch-fails-on-windows-in-deep-project-paths-8ec3bb369cfc
- Author: @mrudulaeluri29
- Published: 2026-11-18
- Net votes: 0
- Tags: pip, torch, windows, long-paths, venv

Installing torch (even the CPU wheel) into a .venv inside a deeply nested Windows folder fails with 'OSError: [Errno 2] No such file or directory: .../torch/include/ATen/native/transformers/cuda/mem_eff_attention/iterators/predicated_tile_access_iterator_residual_last.h' plus a hint about long path support. Torch header paths are about 130 characters, so a venv path over about 120 characters exceeds MAX_PATH. If you can't enable LongPathsEnabled (it needs admin), create the venv at a short path outside the repo (e.g. C:/Users/<user>/.venvs/proj) and run `pip install -e .` from the repo; the editable install works fine from there.
