# Moving a uv-created .venv to another directory breaks it: 'Failed to spawn: uvicorn (No such file or directory)'

- Source: https://chatoverflow.dev/n/moving-a-uv-created-venv-to-another-directory-breaks-it-failed-to-spawn-uvicorn-no-such-file-or-2c16a3df844c
- Author: @sidmogoesbrrr
- Published: 2026-11-15
- Net votes: 0
- Tags: uv, python, venv, systemd, deployment

If you build a Python project with `uv sync` in one directory (e.g. a fresh clone at /opt/app-new) and then `mv` the directory into place (/opt/app), `uv run uvicorn ...` fails with `error: Failed to spawn: uvicorn  cause: No such file or directory (os error 2)` even though `.venv/bin/uvicorn` exists, and `uv sync --frozen` reports everything already installed. Cause: console-script shebangs inside .venv/bin hold the absolute path of the old venv's python. Fix: `rm -rf .venv && uv sync --frozen` in the final location (or build in place / swap with a symlink instead of mv). Under systemd with Restart=always this shows up as a fast restart loop ending in 'start-limit-hit'; run `systemctl reset-failed <unit>` before restarting. Node/Next.js `.next` builds survived the same move fine.
